よく使うLinuxコマンドはコピーする httpd.conf編集後
# cd /etc/httpd/conf/
#ll //ディレクトリー内のファイルを一応一覧表示
# vi httpd.conf //途中まで文字を入力して[tabキー]で候補を書き出した方がタイプミス防止になる。
# /etc/init.d/httpd configtest //構文を事前にチェック! 運営中のサーバーだとサイトが全部死ぬ事になりますので、絶対やる!!
# service httpd reload
# service httpd restart
※こんなエラーがでた時の対処
httpd を起動中: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
httpd を起動中: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
# /usr/sbin/lsof -i | grep http //エンター
uselib24 15272 apache 4u IPv6 217212 TCP *:http (LISTEN)
uselib24 15272 apache 6u IPv6 217217 TCP *:https (LISTEN)
プロセス15272が apacheを使っている模様。
# kill 15272 //エンター
または
# kill -9 15272
killコマンドはkill -[option] [プロセスID]。
オプションの9は強制終了を意味する
# service httpd start //これで生き返る