WEBサーバのインストール
yum -y install httpd ← httpdインストール
yum -y install php php-mbstring ← php、php-mbstringインストール
WEBサーバ設定
[root@centos ~]# vi /etc/httpd/conf/httpd.conf ← httpd設定ファイル編集
ServerTokens OS
↓
ServerTokens Prod ← エラーページ等でOS名を表示しないようにする
#ServerName www.example.com:80
↓
ServerName centossrv.com:80 ← サーバー名を指定
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
↓
Options Includes ExecCGI FollowSymLinks ← CGI,SSIの許可
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
↓
AllowOverride All ← .htaccessの許可
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
↓
LogFormat "%h %l %u %t \"%!414r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined ← 長すぎるURI(414エラー)はログに記録しない
#
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
SetEnvIf Request_URI "default\.ida" no_log ← 追加(wormからのアクセスをログに記録しない)
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 192.168.1 no_log ← 追加(内部からのアクセスをログに記録しない)
SetEnvIf Remote_Addr 127.0.0.1 no_log ← 追加(自ホストからのアクセスをログに記録しない)
CustomLog logs/access_log combined env=!no_log ← 上記以外のアクセスをログに記録する
ServerSignature On
↓
ServerSignature Off ← エラーページでサーバー情報を表示しないようにする
AddDefaultCharset UTF-8
↓
#AddDefaultCharset UTF-8 ← コメントアウト(文字化け対応)
#AddHandler cgi-script .cgi
↓
AddHandler cgi-script .cgi .pl ← CGIスクリプトに.plを追加
<Directory "/var/www/icons">
Options Indexes MultiViews
↓
Options MultiViews ← iconsディレクトリのファイル一覧を表示しないようにする
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ドキュメントルート所有者変更
chown ftp_user. /var/www/html/ ← ドキュメントルート所有者を変更(ftp_userは例)
WEBサーバ起動
[root@ftp_user ~]# /etc/rc.d/init.d/httpd start ← httpd起動
httpd を起動中: [ OK ]
[root@ftp_user ~]# chkconfig httpd on ← httpd自動起動設定

