Apache httpd / CentOS6

1. httpd をインストールする。

[root@www ~]# yum -y install httpd


2. httpd の設定。サーバーの名前等は適宜自身の環境に置き換えること。

root@www ~]# vi /etc/httpd/conf/httpd.conf

# 44行目:変更ServerTokens Prod

# 76行目:キープアライブオンKeepAlive On

# 262行目:管理者アドレス指定ServerAdmin root@pidam.net

# 338行目:変更AllowOverride Al

l# 276行目:コメント解除しサーバー名指定ServerName www.pidam.net:80

# 402行目:ディレクトリ名のみでアクセスできるファイル名を追加

DirectoryIndex index.html index.htm

# 536行目:変更ServerSignature Off

[root@www ~]# /etc/rc.d/init.d/httpd start Starting httpd:     [ OK ]

[root@www ~]# chkconfig httpd on 

 

3. IPTables を有効にしている場合は、HTTP ポートの許可が必要。

HTTP は 80/TCP を使用。「-I INPUT 7」の箇所は適宜自身の環境を確認して、置き換えること。

[root@www ~]# iptables -I INPUT 7 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT