Webサーバー

Apache

/etc/httpd/conf/httpd.confを修正。

ServerAdmin webmaster@linux-life.net
ServerName linux-life.net
DocumentRoot /home/webmaster/www
UserDir www
<Directory /home/*/www>
 Options ExecCGI
</Directory>
AddHandler cgi-script .cgi
AddHandler cgi-script .rhtml
DirectoryIndex index.cgi index.rhtml index.html
# /etc/rc.d/inetd/httpd restart

ユーザー作成時にホームディレクトリにwwwディレクトリを作成するように設定。

# mkdir /etc/skel/www

追加設定

ローカルアクセスを記録しないようにする。
/etc/httpd/conf/httpd.conf に以下の太字の部分を追加。

SetEnvIf Remote_Addr 192.168.0. no_log
CustomLog /var/log/httpd/access_log combined env=!no_log

エラー用ページの作成

ErrorDocument 403 /error/403/index.rhtml
ErrorDocument 404 /error/404/index.rhtml
ErrorDocument 500 /error/500/index.rhtml

ログを一年分残す。
/etc/logrotate.d/apacheに以下の太文字の部分を追加。

/var/log/httpd/access_log {
  rotate 53
  missingok
  postrotate
    /bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
  endscript
}
Linux Life
Vine Linux > サーバー > 各種設定 > Webサーバー