[root@ufuso ~]# yum -y install httpd ← httpdをインストール
Loaded plugins: priorities, refresh-packagekit, security
Setting up Install Process
Package httpd-2.2.15-15.sl6.1.x86_64 already installed and latest version
Nothing to do ← すでにインストール済み
[root@ufuso ~]# vi /etc/httpd/conf/httpd.conf ← httpd設定ファイル編集
ServerTokens Prod ← OSをProdに変えてエラーページ等でOS名を表示しないようにする
KeepAlive On ← OffをOnに変えて接続が切れていないか定期的にチェックする
ServerAdmin webmaster@ufuso.dip.jp
← エラーページ等に表示される管理者メールアドレスを指定
#ServerName www.example.com:80 ufuso.dip.jp: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 Includes ExecCGI FollowSymLinks ← Indexesを削除してファイルの一覧表示を防ぎ、
Includes ExecCGIを追記して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 All ← Noneを Allに変えて、.htaccessの許可
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
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 ← wormからのアクセスをログに記録しない
SetEnvIf Request_URI "root.exe" no_log ← wormからのアクセスをログに記録しない
SetEnvIf Request_URI "Admin.dll" no_log ← wormからのアクセスをログに記録しない
SetEnvIf Request_URI "NULL.IDA" no_log ← wormからのアクセスをログに記録しない
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 Off ← OnをOffに変更してエラーページ等でApacheのバージョンを表示しないようにする
<Directory "/var/www/icons">
Options MultiViews ← Indexes、FollowSymLinksを削除して、
iconsディレクトリのファイル一覧を表示しないようにする
AllowOverride None
Order allow,deny
Allow from all
</Directory>
#AddDefaultCharset UTF-8 ← 行頭に#を付けて、無効にする
AddHandler cgi-script .cgi .pl ← 行頭の#を削除して有効にし、CGIスクリプトに.plを追加