:CentOS6x設定など
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
[[:お仕事メモ]]
*CentOS6.2のコマンドなど [#r4df3743]
#contents
*基本 [#a69a1ad7]
**Runlevelの変更 [#rf8bf4bb]
-確認
--$runlevel
--$who -r
---数値の内容や意味は下図参照
-設定
--/etc/inittab
id:[Runlevel]:initdefault:
-一時的な設定変更
--#telinit [ランレベル]
|動作モード|内容|
|0|シャットダウン(システム停止)|
|1|シングルユーザモード(rootのみ)|
|2|ネットワークなしマルチユーザモード|
|3|通常のマルチユーザモード(テキストログイン)|
|4|未使用|
|5|グラフィカルログインによるマルチユーザモード|
|6|システムの再起動|
動作モードにより起動されるプログラムが違う。
/etc/rc.d/rc[?].d // ?部分に数字が入る
各プログラムの起動スクリプトへのリンク名の意味。
|K|kill|実行されないスクリプト|
|S|start|実行されるスクリプト|
|数字|-|優先順位|
**IPv6無効化 [#rf4f2286]
-確認
--$ifconfig
--$lsmod | grep ipv6
--#chkconfig --list ip6tables
-設定
--/etc/modprobe.d/ipv6.conf
---+options ipv6 disable=no
--不要だが、明示的に追記するも良し。
--/etc/sysconfig/network
---+NETWORKING_IPV6=no
---+IPV6INIT=no
---+IPV6_AUTOCONF=no
--自動起動設定
---#chkconfig ip6tables off
-CentOS5xでの設定?
--/etc/modprobe.d/disable-ipv6.conf
---+alias net-pf-10 off
---+options ipv6 disable=1
**アカウント(ユーザ)作成 [#md4d3de1]
-#useradd ユーザ名
-#passwd パスワード
**SELINUX無効化 [#uf7b280c]
-確認
--/usr/sbin/getenforce
--getenforce
---Enforcing //有効
---Permissive //無効
-一時的な設定変更
--/usr/sbin/setenforce permissive //無効化 0でも可
--/usr/sbin/setenforce enforcing //有効化 1でも可
-自動反映設定
--/etc/selinux/config
---SELINUX=enforcing //有効化
---SELINUX=disable //無効化
*Telnet [#c33f5279]
SSHがあればいいと思う。
-インストール
--#yum -y install telnet-server
-確認
--rpm -qa | grep telnet //表示があればインストールされて...
-設定
--/etc/hosts.allow
---+in.telnetd : IPアドレス //192.168.0. 127.0.0.1など
--/etc/hosts.deny
---ALL : ALL
-有効化
--/etc/xinetd.d/telnet
disable = yes -> disable = no
-スーパーサーバデーモンの再起動
--/etc/init.d/xinetd restart
+Pingは繋がるか?
++繋がる。23番ポートがブロックされている?
+xinetdサービスは起動しているか?
++service xinetd restart
+++ps -ef grep xinetd //表示されればOK。
+telnetサービスは起動しているか?
++chkconfig --list | grep telnet
telnet : on //onならば起動している。
+23番ポートはLISTENになっているか?
++netstat -lnp | grep 23
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 2591/xinetd
// unix 2 [ACC] STREAM LISTENING 7239 I/init @/com/ubuntu...
// LISTENになっていない場合、xinetdとtelnet-serverがリン...
+SELINUXが有効になっているか・
++別項(上記)による。
+iptablesが邪魔していないか?
++/etc/init.d/iptables stop
++->動く! //iptablesの設定による接続不良と診断。
-iptables設定
--/etc/sysconfig/iptables
初期設定
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -...
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
-iptablesバックアップ
--#iptables-save > ファイル名 // /home/adminに保存され...
---#iptables-restore < ファイル名 //戻し方
-設定一新
--初期設定を破棄して新たに設定をし直す。
---+:RH-Firewall-1-INPUT - [0:0]
---+-A RH-Firewall-1-INPUT -p tcp --dport 23 -j ACCEPT
---+-A RH-Firewall-1-INPUT -- tcp --sport 23 -j ACCEPT
*FTP [#nc1af2ae]
-インストール
--#yum -y install vsftpd
-設定
--/etc/vsftpd/vsftpd.conf
---+anonymous_enable = YES -> NO //匿名ユーザのログイン許...
---+#idle_session_timeout = 600 -> コメントアウト //アイ...
---+#data_connection_timeout = 120 -> コメントアウト //接...
---+#ascii_upload_enable = YES -> コメントアウト //アスキ...
---+#ascii_download_enable = YES -> コメントアウト //アス...
---+#ftpd_banner = 省略 -> コメントアウト(任意) //ログ...
---+#chroot_list_enable = YES -> コメントアウト //ホーム...
---+#chroot_list_file = /etc/vsftpd/chroot_list //ホーム...
---+ls_recurse_enable = YES -> コメントアウト //ディレク...
---+pam_service_name = vsftpd //PAM認証設定
---+userlist_enable = YES // /etc/vsftpd/user_listを参照...
定義なし(デフォルト)の場合、YESで処理される。~
NOの場合指定ユーザのみを許可。~
ただし、/etc/vsftpd/ftpusers内にユーザが設定されていると...
---+tcp_wrappers = YES //tcpwrapperを利用するか
-iptables設定
--/etc/sysconfig/iptables
---+-A RH-Firewall-1-INPUT -p tcp --dport 20 -j ACCEPT
---+-A RH-Firewall-1-INPUT -p tcp --sport 20 -j ACCEPT
---+-A RH-Firewall-1-INPUT -p tcp --dport 21 -j ACCEPT
---+-A RH-Firewall-1-INPUT -p tcp --sport 21 -j ACCEPT
-tcp_wrapper(hosts)設定
--/etc/hosts.allow
---+vsftpd : 192.168.136. 127.0.0.1
接続設定が共通ならばin.telnet, sshdに追加する形でも良い...
-chroot_list
--/etc/vsftpd/chroot_list //ホームパスより上に移動できな...
-自動起動
--chkconfig vsftpd on
-接続確認
*NTP [#t9f8a732]
-インストール
--#yum -y install ntp
-設定
--/etc/ntp.conf
---+server IPアドレス
%% 今回はntp.nict.jpのIPアドレスを複数指定することになっ...
nslookupで逆引きしてそのIPを指定する。なおIPは以下の通り。
133.243.238.163
133.243.238.164
133.243.238.243
133.243.238.244%%
-NTP起動
--/etc/rc.d/init.d/ntpd start
-自動起動
--chkconfig ntpd on //chkconfig --list ntpdで確認
-動作確認
--ntpq -p
-訂正
--/etc/ntp.conf
+server -4 ntp.nict.jp
+server -4 ntp.ring.jp
--これで良かったらしい。
*Apache(httpd) [#y94d2f6a]
**通常起動 [#r2316fd3]
-インストール
--#yum -y install httpd
--#yum -y install php php-mbstring
-起動
--service httpd start
-自動起動
--chkconfig httpd on
-確認
--ブラウザにIPを打ち込んで立ち上がってるか確認。
-ファイル設置
--/var/www/htmlにindex.htmlファイルなどを設置してブラウザ...
-設定 //初期設定で動作確認して設定を弄る方向へ。
--/etc/httpd/conf/httpd.conf
---+Server Tokens OS -> Server Tokens Prod //エラーページ...
---+#ServerName www.example.com:80 -> ServerName centos.c...
---+Options Indexes FollowSymLinks -> Options Includes Ex...
---+AllowOverride None -> AllowOverride All
---+DirectoryIndex index.html index.html.var //index.html...
index.htm index.cgi index.php index.shtml index.txt
---+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" ...
---+ServerSignature On -> ServerSignature Off ← エラー...
---+AddDefaultCharset UTF-8 //コメントアウト
---+#AddHandler cgi-script .cgi -> AddHandler cgi-script ...
---+Options Indexes MultiViews FollowSymLinks -> Options ...
SetEnvIf Request_URI "default\.ida" no_log
SetEnvIf Request_URI "cmd\.exe" no_log
SetEnvIf Request_URI "root\.exe" no_log
SetEnvIf Request_URI "Admin\.dll" no_log
SetEnvIf Request_URI "NULL\.IDA" no_log
SetEnvIf Remote_Addr 127.0.0.1 no_log
CustomLog logs/access_log combined env=!no_log
--リンクを通す
---#ln -s /usr/bin/perl /usr/local/bin/perl
--オーナー変更
---chown admin.admin /var/www/html/
---#ll /var/www/
-hostsファイルを書き換える
--/etc/hosts
---+192.168.136.152 mhvm.kogei.jp mhvm
---+127.0.0.1 localhost.localdomain localhost
-Windowsのhostsファイルも書き換える
--C:\Windows\System32\drivers\etc\hosts
---+192.168.136.152 mhvm.kogei.jp mhvm
**バーチャルホスト [#p1bde4f5]
-基本設定(前提)
|項目|メイン|バーチャルホスト|
|アドレス|http://mhvm.kogei.jp|http://mhvh00.kogei.jp|
|DocumentRoot|/var/www/html|/var/www/html/virtualhost00|
|アクセスログ|/var/log/httpd/access_log|/var/log/httpd/vi...
|エラーログ|/var/log/httpd/error_log|/var/log/httpd/virtu...
-設定
--/etc/httpd/conf/httpd.conf
---+ServerName ~:80 //#でコメントアウト
---+#NameVirtualhost *:80 //#を外して有効化
---+Include /etc/httpd/conf.d/virtualhost*.conf //設定フ...
--/etc/httpd/conf.d/内に以下を作成していく。
--/etc/httpd/conf.d/virtualhost.conf //設定ファイル
<VirtualHost *:80>
ServerName any
# <Location />
# Order deny,allow
# Deny from all
# </Location>
DocumentRoot /var/www/html
</VirtualHost>
--/etc/http/conf.d/virtualhost-mh-vm.kogei.jp.conf //メイ...
<VirtualHost *:80>
ServerName mh-vm.kogei.jp
DocumentRoot /var/www/html
SetEnvIf Request_URI "\.(gif)|(jpeg)|(jpg)|(png)...
ErrorLog logs/main-error_log
CustomLog logs/main-access_log access env=!no_log
CustomLog logs/main-referer_log referer env=!no_...
CustomLog logs/main-agent_log agent env=!no_log
</VirtualHost>
--/etc/httpd/conf.d/virtualhost-mh-vh00.kogei.jp.conf //...
<VirtualHost *:80>
ServerName mh-vh00.kogei.jp
DocumentRoot /var/www/html/virtual00
SetEnvIf Request_URI "\.(gif)|(jpeg)|(jpg)|(png)...
CustomLog logs/virtual00-access_log access env=!...
CustomLog logs/virtual00-referer_log referer env...
CustomLog logs/virtual00-agent_log agent env=!no...
</VirtualHost>
-ディレクトリ作成
--mkdir /var/www/html/virtual00 //chmodとchown admin.admi...
-httpdサービス再起動
-hostsファイル設定
--/etc/hosts
192.168.136.152 mhamachi-vm.kogei.jp mhamachi-vm
192.168.136.152 mh-vh00.kogei.jp mh-vh00
127.0.0.1 localhost.localdomain localhost
hosts
bind
*仮想コンソールを減らす [#h2168b7b]
alt+F1~alt+F6の仮想コンソールを減らす。
/etc/sysconfig/init
ACTIVE_CONSOLES=/dev/tty[1-6] -> ACTIVE_CONSOLES=/dev/tt...
*APIPAの169.254.0.0を消す [#d0894ba1]
-確認
--netstat -rn
-設定
--/etc/sysconfig/network
---+NOZEROCONF=yes //追加
-ネットワークを再起動して確認。
*不要サービス削除 [#z0b36f53]
-検索
--/etc/rc3.d/
--ls S*
-除去
--stsysv
*時計が未来になっている [#yfa10c7b]
-/etc/sysconfig/clock
--UTC=false
--ARC=false
*WindowsでTelnet [#jdc76eba]
コントロールパネル -> プログラム -> Windowsの機能の有効化...
*主要FTPコマンド [#z564779a]
独自解釈を含む。
|ls|ファイルを見る|
|pwd|作業ディレクトリを見る|
|cd|作業ディレクトリを移動する|
|del|ファイルを消す|
|rmdir|ディレクトリを消す|
|bye|切断|
|bin|バイナリモード|
|ascii|アスキーモード|
|put|ファイルのアップロード|
|get|ファイルのダウンロード|
|prompt|対話モード|
|bell|ベル|
|hash|ハッシュ|
|!ls|-|
*MySQL [#ea3fba76]
-#yum install -y mysql-server
-#service mysqld start
MySQL データベースを初期化中: Installing MySQL system t...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your s...
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USE...
To do so, start the server, then issue the following com...
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h mhamachi-vm.kogei.jp pass...
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug sc...
...
mysqld を起動中: ...
-#/etc/rc.d/init.d/mysqld start
mysqld を起動中: ...
-#service mysqld stop
mysqld を停止中: ...
-#service mysqld start
mysqld を起動中: ...
[[:お仕事メモ]]
終了行:
[[:お仕事メモ]]
*CentOS6.2のコマンドなど [#r4df3743]
#contents
*基本 [#a69a1ad7]
**Runlevelの変更 [#rf8bf4bb]
-確認
--$runlevel
--$who -r
---数値の内容や意味は下図参照
-設定
--/etc/inittab
id:[Runlevel]:initdefault:
-一時的な設定変更
--#telinit [ランレベル]
|動作モード|内容|
|0|シャットダウン(システム停止)|
|1|シングルユーザモード(rootのみ)|
|2|ネットワークなしマルチユーザモード|
|3|通常のマルチユーザモード(テキストログイン)|
|4|未使用|
|5|グラフィカルログインによるマルチユーザモード|
|6|システムの再起動|
動作モードにより起動されるプログラムが違う。
/etc/rc.d/rc[?].d // ?部分に数字が入る
各プログラムの起動スクリプトへのリンク名の意味。
|K|kill|実行されないスクリプト|
|S|start|実行されるスクリプト|
|数字|-|優先順位|
**IPv6無効化 [#rf4f2286]
-確認
--$ifconfig
--$lsmod | grep ipv6
--#chkconfig --list ip6tables
-設定
--/etc/modprobe.d/ipv6.conf
---+options ipv6 disable=no
--不要だが、明示的に追記するも良し。
--/etc/sysconfig/network
---+NETWORKING_IPV6=no
---+IPV6INIT=no
---+IPV6_AUTOCONF=no
--自動起動設定
---#chkconfig ip6tables off
-CentOS5xでの設定?
--/etc/modprobe.d/disable-ipv6.conf
---+alias net-pf-10 off
---+options ipv6 disable=1
**アカウント(ユーザ)作成 [#md4d3de1]
-#useradd ユーザ名
-#passwd パスワード
**SELINUX無効化 [#uf7b280c]
-確認
--/usr/sbin/getenforce
--getenforce
---Enforcing //有効
---Permissive //無効
-一時的な設定変更
--/usr/sbin/setenforce permissive //無効化 0でも可
--/usr/sbin/setenforce enforcing //有効化 1でも可
-自動反映設定
--/etc/selinux/config
---SELINUX=enforcing //有効化
---SELINUX=disable //無効化
*Telnet [#c33f5279]
SSHがあればいいと思う。
-インストール
--#yum -y install telnet-server
-確認
--rpm -qa | grep telnet //表示があればインストールされて...
-設定
--/etc/hosts.allow
---+in.telnetd : IPアドレス //192.168.0. 127.0.0.1など
--/etc/hosts.deny
---ALL : ALL
-有効化
--/etc/xinetd.d/telnet
disable = yes -> disable = no
-スーパーサーバデーモンの再起動
--/etc/init.d/xinetd restart
+Pingは繋がるか?
++繋がる。23番ポートがブロックされている?
+xinetdサービスは起動しているか?
++service xinetd restart
+++ps -ef grep xinetd //表示されればOK。
+telnetサービスは起動しているか?
++chkconfig --list | grep telnet
telnet : on //onならば起動している。
+23番ポートはLISTENになっているか?
++netstat -lnp | grep 23
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN 2591/xinetd
// unix 2 [ACC] STREAM LISTENING 7239 I/init @/com/ubuntu...
// LISTENになっていない場合、xinetdとtelnet-serverがリン...
+SELINUXが有効になっているか・
++別項(上記)による。
+iptablesが邪魔していないか?
++/etc/init.d/iptables stop
++->動く! //iptablesの設定による接続不良と診断。
-iptables設定
--/etc/sysconfig/iptables
初期設定
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -...
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
-iptablesバックアップ
--#iptables-save > ファイル名 // /home/adminに保存され...
---#iptables-restore < ファイル名 //戻し方
-設定一新
--初期設定を破棄して新たに設定をし直す。
---+:RH-Firewall-1-INPUT - [0:0]
---+-A RH-Firewall-1-INPUT -p tcp --dport 23 -j ACCEPT
---+-A RH-Firewall-1-INPUT -- tcp --sport 23 -j ACCEPT
*FTP [#nc1af2ae]
-インストール
--#yum -y install vsftpd
-設定
--/etc/vsftpd/vsftpd.conf
---+anonymous_enable = YES -> NO //匿名ユーザのログイン許...
---+#idle_session_timeout = 600 -> コメントアウト //アイ...
---+#data_connection_timeout = 120 -> コメントアウト //接...
---+#ascii_upload_enable = YES -> コメントアウト //アスキ...
---+#ascii_download_enable = YES -> コメントアウト //アス...
---+#ftpd_banner = 省略 -> コメントアウト(任意) //ログ...
---+#chroot_list_enable = YES -> コメントアウト //ホーム...
---+#chroot_list_file = /etc/vsftpd/chroot_list //ホーム...
---+ls_recurse_enable = YES -> コメントアウト //ディレク...
---+pam_service_name = vsftpd //PAM認証設定
---+userlist_enable = YES // /etc/vsftpd/user_listを参照...
定義なし(デフォルト)の場合、YESで処理される。~
NOの場合指定ユーザのみを許可。~
ただし、/etc/vsftpd/ftpusers内にユーザが設定されていると...
---+tcp_wrappers = YES //tcpwrapperを利用するか
-iptables設定
--/etc/sysconfig/iptables
---+-A RH-Firewall-1-INPUT -p tcp --dport 20 -j ACCEPT
---+-A RH-Firewall-1-INPUT -p tcp --sport 20 -j ACCEPT
---+-A RH-Firewall-1-INPUT -p tcp --dport 21 -j ACCEPT
---+-A RH-Firewall-1-INPUT -p tcp --sport 21 -j ACCEPT
-tcp_wrapper(hosts)設定
--/etc/hosts.allow
---+vsftpd : 192.168.136. 127.0.0.1
接続設定が共通ならばin.telnet, sshdに追加する形でも良い...
-chroot_list
--/etc/vsftpd/chroot_list //ホームパスより上に移動できな...
-自動起動
--chkconfig vsftpd on
-接続確認
*NTP [#t9f8a732]
-インストール
--#yum -y install ntp
-設定
--/etc/ntp.conf
---+server IPアドレス
%% 今回はntp.nict.jpのIPアドレスを複数指定することになっ...
nslookupで逆引きしてそのIPを指定する。なおIPは以下の通り。
133.243.238.163
133.243.238.164
133.243.238.243
133.243.238.244%%
-NTP起動
--/etc/rc.d/init.d/ntpd start
-自動起動
--chkconfig ntpd on //chkconfig --list ntpdで確認
-動作確認
--ntpq -p
-訂正
--/etc/ntp.conf
+server -4 ntp.nict.jp
+server -4 ntp.ring.jp
--これで良かったらしい。
*Apache(httpd) [#y94d2f6a]
**通常起動 [#r2316fd3]
-インストール
--#yum -y install httpd
--#yum -y install php php-mbstring
-起動
--service httpd start
-自動起動
--chkconfig httpd on
-確認
--ブラウザにIPを打ち込んで立ち上がってるか確認。
-ファイル設置
--/var/www/htmlにindex.htmlファイルなどを設置してブラウザ...
-設定 //初期設定で動作確認して設定を弄る方向へ。
--/etc/httpd/conf/httpd.conf
---+Server Tokens OS -> Server Tokens Prod //エラーページ...
---+#ServerName www.example.com:80 -> ServerName centos.c...
---+Options Indexes FollowSymLinks -> Options Includes Ex...
---+AllowOverride None -> AllowOverride All
---+DirectoryIndex index.html index.html.var //index.html...
index.htm index.cgi index.php index.shtml index.txt
---+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" ...
---+ServerSignature On -> ServerSignature Off ← エラー...
---+AddDefaultCharset UTF-8 //コメントアウト
---+#AddHandler cgi-script .cgi -> AddHandler cgi-script ...
---+Options Indexes MultiViews FollowSymLinks -> Options ...
SetEnvIf Request_URI "default\.ida" no_log
SetEnvIf Request_URI "cmd\.exe" no_log
SetEnvIf Request_URI "root\.exe" no_log
SetEnvIf Request_URI "Admin\.dll" no_log
SetEnvIf Request_URI "NULL\.IDA" no_log
SetEnvIf Remote_Addr 127.0.0.1 no_log
CustomLog logs/access_log combined env=!no_log
--リンクを通す
---#ln -s /usr/bin/perl /usr/local/bin/perl
--オーナー変更
---chown admin.admin /var/www/html/
---#ll /var/www/
-hostsファイルを書き換える
--/etc/hosts
---+192.168.136.152 mhvm.kogei.jp mhvm
---+127.0.0.1 localhost.localdomain localhost
-Windowsのhostsファイルも書き換える
--C:\Windows\System32\drivers\etc\hosts
---+192.168.136.152 mhvm.kogei.jp mhvm
**バーチャルホスト [#p1bde4f5]
-基本設定(前提)
|項目|メイン|バーチャルホスト|
|アドレス|http://mhvm.kogei.jp|http://mhvh00.kogei.jp|
|DocumentRoot|/var/www/html|/var/www/html/virtualhost00|
|アクセスログ|/var/log/httpd/access_log|/var/log/httpd/vi...
|エラーログ|/var/log/httpd/error_log|/var/log/httpd/virtu...
-設定
--/etc/httpd/conf/httpd.conf
---+ServerName ~:80 //#でコメントアウト
---+#NameVirtualhost *:80 //#を外して有効化
---+Include /etc/httpd/conf.d/virtualhost*.conf //設定フ...
--/etc/httpd/conf.d/内に以下を作成していく。
--/etc/httpd/conf.d/virtualhost.conf //設定ファイル
<VirtualHost *:80>
ServerName any
# <Location />
# Order deny,allow
# Deny from all
# </Location>
DocumentRoot /var/www/html
</VirtualHost>
--/etc/http/conf.d/virtualhost-mh-vm.kogei.jp.conf //メイ...
<VirtualHost *:80>
ServerName mh-vm.kogei.jp
DocumentRoot /var/www/html
SetEnvIf Request_URI "\.(gif)|(jpeg)|(jpg)|(png)...
ErrorLog logs/main-error_log
CustomLog logs/main-access_log access env=!no_log
CustomLog logs/main-referer_log referer env=!no_...
CustomLog logs/main-agent_log agent env=!no_log
</VirtualHost>
--/etc/httpd/conf.d/virtualhost-mh-vh00.kogei.jp.conf //...
<VirtualHost *:80>
ServerName mh-vh00.kogei.jp
DocumentRoot /var/www/html/virtual00
SetEnvIf Request_URI "\.(gif)|(jpeg)|(jpg)|(png)...
CustomLog logs/virtual00-access_log access env=!...
CustomLog logs/virtual00-referer_log referer env...
CustomLog logs/virtual00-agent_log agent env=!no...
</VirtualHost>
-ディレクトリ作成
--mkdir /var/www/html/virtual00 //chmodとchown admin.admi...
-httpdサービス再起動
-hostsファイル設定
--/etc/hosts
192.168.136.152 mhamachi-vm.kogei.jp mhamachi-vm
192.168.136.152 mh-vh00.kogei.jp mh-vh00
127.0.0.1 localhost.localdomain localhost
hosts
bind
*仮想コンソールを減らす [#h2168b7b]
alt+F1~alt+F6の仮想コンソールを減らす。
/etc/sysconfig/init
ACTIVE_CONSOLES=/dev/tty[1-6] -> ACTIVE_CONSOLES=/dev/tt...
*APIPAの169.254.0.0を消す [#d0894ba1]
-確認
--netstat -rn
-設定
--/etc/sysconfig/network
---+NOZEROCONF=yes //追加
-ネットワークを再起動して確認。
*不要サービス削除 [#z0b36f53]
-検索
--/etc/rc3.d/
--ls S*
-除去
--stsysv
*時計が未来になっている [#yfa10c7b]
-/etc/sysconfig/clock
--UTC=false
--ARC=false
*WindowsでTelnet [#jdc76eba]
コントロールパネル -> プログラム -> Windowsの機能の有効化...
*主要FTPコマンド [#z564779a]
独自解釈を含む。
|ls|ファイルを見る|
|pwd|作業ディレクトリを見る|
|cd|作業ディレクトリを移動する|
|del|ファイルを消す|
|rmdir|ディレクトリを消す|
|bye|切断|
|bin|バイナリモード|
|ascii|アスキーモード|
|put|ファイルのアップロード|
|get|ファイルのダウンロード|
|prompt|対話モード|
|bell|ベル|
|hash|ハッシュ|
|!ls|-|
*MySQL [#ea3fba76]
-#yum install -y mysql-server
-#service mysqld start
MySQL データベースを初期化中: Installing MySQL system t...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your s...
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USE...
To do so, start the server, then issue the following com...
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h mhamachi-vm.kogei.jp pass...
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug sc...
...
mysqld を起動中: ...
-#/etc/rc.d/init.d/mysqld start
mysqld を起動中: ...
-#service mysqld stop
mysqld を停止中: ...
-#service mysqld start
mysqld を起動中: ...
[[:お仕事メモ]]
ページ名: