(1)Apache設定
[root@fedora ~]# vi /etc/httpd/conf/httpd.conf ← Apache設定ファイル編集
ServerTokens OS
↓
ServerTokens Prod ← エラーページ等でOS名を表示しないようにする
#ServerName www.example.com:80
↓
ServerName fedorasrv.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 ← エラーページ等でApacheのバージョンを表示しないようにする
AddDefaultCharset UTF-8
↓
#AddDefaultCharset UTF-8 ← コメントアウト
#AddHandler cgi-script .cgi
↓
AddHandler cgi-script .cgi .pl ← CGIスクリプトに.plを追加
[root@fedora ~]# rm -f /etc/httpd/conf.d/welcome.conf ← テストページ削除
[root@fedora ~]# rm -f /var/www/error/noindex.html ← テストページ削除
|
(2)Perlコマンドへ/usr/local/bin/perlでもアクセスできるようにする。
[root@fedora ~]# ln -s /usr/bin/perl /usr/local/bin/perl ← /usr/local/bin/perlから/usr/bin/perlへリンクをはる
[root@fedora ~]# whereis perl ← Perlのパスを確認
perl: /usr/bin/perl /usr/local/bin/perl /usr/share/man/man1/perl.1.gz
← Perlのパスに/usr/local/bin/perlが表示されることを確認
|
|