≪ トップ |
2005年11月04日
Webサーバインストール
httpdインストール
phpインストール
httpd設定ファイル編集
エラーページ等でOS名を表示しないようにする(変更)
エラーページ等に表示される管理者メールアドレスを指定(変更)
サーバ名を指定(変更とコメントアウト解除)
CGI,SSIの許可と.htaccessの許可(変更)
‥‥‥
Options Indexes FollowSymLinks
↓
Options Includes ExecCGI FollowSymLinks
‥‥‥
AllowOverride None
↓
AllowOverride All
長すぎるURI(414エラー)はログに記録しない(変更)
↓
LogFormat "%h %l %u %t \"%!414r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
wormからのアクセスをログに記録しない(追加)
内部からのアクセスをログに記録しない(追加)
上記以外のアクセスをログに記録する(追加)
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
SetEnvIf Request_URI "default\.ida" no_log
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
CustomLog logs/access_log combined env=!no_log
エラーページ等でApacheのバージョンを表示しないようにする(変更)
icons ディレクトリのファイル一覧を表示しないようにする(削除)
Alias /icons/ "/var/www/icons/"
<Directory "/var/www/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
#
文字コード UTF-8 指定でなければコメントアウト
CGIスクリプトに.plを追加(追加とコメントアウト解除)
テストページ削除
[root@server ~]# rm -f /var/www/error/noindex.html
/usr/local/bin/perl から /usr/bin/perl へリンクをはる
確認
ドキュメントルート所有者変更(所有者 haruka の場合)
確認
Webサーバ起動
自動起動設定,確認
[root@server ~]# chkconfig --list httpd
ルータのポート80番をOPENする
Webページ表示確認(システムの文字コード:UTF-8 用)
HTMLテストページ作成
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>テスト</title>
<body>
テスト
</body>
</html>
http://サーバー名/にアクセス
CGIテストページ作成
print "Content-Type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n";
print "<title>テスト</title>\n";
print "</head>\n";
print "<body>\n";
print "CGIテスト\n";
print "</body>\n";
print "</html>\n";
テスト用CGIパーミッション変更
http://サーバー名/test.cgiにアクセス
SSIテストページ作成
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>テスト</title>
<body>
SSIテスト
<!--#config timefmt="%Y/%m/%d %H:%M:%S" -->
<!--#echo var="DATE_LOCAL" -->
</body>
</html>
http://サーバー名/test.shtmlにアクセス
.htaccess確認
.htaccessファイル作成
.htaccessテストページ作成
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>テスト</title>
<body>
<p>.htaccessによるWebサーバ設定(例としてDirectoryIndex)の変更テスト</p>
このページのファイル名は<!--#echo var="DOCUMENT_NAME" -->
</body>
</html>
http://サーバー名/にアクセスしてindex.shtmlが表示されれば O.K.
PHP確認
PHPテストページ作成
phpinfo();
?>
http://サーバー名/test.phpにアクセス
上記の確認で作成したテスト用ページ等を全て削除する。
[root@server ~]# rm -f /var/www/html/.htaccess
投稿者 ゆう : 2005年11月04日 08:47 | カテゴリー CentOS (27)
トラックバック
http://www.wave440.com/blog/mt-trbk.cgi/137