はじめに
このページではWebサーバーの構築について説明します。CentOS4.2を標準でインストールすると、Appacheも一緒にインストールされているはず。インストールされているかどうかは、下記のコマンドで確認しましょう。# rpm -qa | fgrep httpd
コマンドの結果以下、以下のような応答が得られればAppacheのインストールは完了しています。
httpd-suexec-2.0.52-12.ent
httpd-2.0.52-12.ent
httpd-manual-2.0.52-12.ent
system-config-httpd-1.3.1-1
アパッチのインストールがまだの場合は、こことかここを参考にしてインストールしてください。
サーバーの設定
設定ファイルを開き、最小限の設定をします。# vi /etc/http/conf/httpd.conf
ServerAdmin root@localhost
↓
ServerAdmin masa@206rs.com
#ServerName new.host.name:80
↓
ServerName 206rs.com:80
Options Indexes FollowSymLinks
↓
Options FollowSymLinks Includes ExecCGI
コメントを外す
#UserDir public_html
コメントを外す
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch
IncludesNoExec
#
# Order allow,deny
# Allow from all
#
Order deny,allow
Deny from all
index.htmを追記する
DirectoryIndex index.html index.html.var
↓
DirectoryIndex index.html index.htm index.html.var
下記を追記する
Alias /mt-static/ "/var/www/mt/static/"
コメントにする
#AddDefaultCharset UTF-8
コメントを外す
#AddHandler cgi-script .cgi
下記を追記
ServerName 206rs.com:80
NameVirtualHost 192.168.0.5
ServerAdmin webmaster@206rs.com
DocumentRoot /var/www/html
ServerName www.206rs.com
Options MultiViews SymLinksIfOwnerMatch ExecCGI
IncludesNoExec
ErrorLog logs/www.error_log
CustomLog /var/log/httpd/www.access_log combined
Options MultiViews SymLinksIfOwnerMatch ExecCGI
IncludesNoExec
ServerAdmin toshico@206rs.com
DocumentRoot /home/toshico/public_html/clover_home
ServerName clover.206rs.com
ErrorLog /var/log/httpd/clover.error_log
CustomLog /var/log/httpd/clover.access_log combined
Options MultiViews SymLinksIfOwnerMatch ExecCGI
IncludesNoExec
ServerAdmin masa@206rs.com
DocumentRoot /home/foto
ServerName foto.206rs.com
ErrorLog /var/log/httpd/foto.error_log
CustomLog /var/log/httpd/foto.access_log combined