
|Top|WEBサーバの設定(APACHE2)
WEBサーバのAPACHE2.0を設定します!
公開するディレクトリはデフォルトの/var/www/html/
まずは・・・Install!
# apt-get install httpd
次は設定ファイルを環境に合わせます!
# vi /etc/httpd/conf/httpd.conf
ServerAdmin kawasemi@kwne.jp ※管理者のメールアドレスを記述
Options IncludesNoExec ExecCGI FollowSymLinks ※CGI SSLの許可
AllowOverride All ※.htaccessの許可
ScriptAlias /cgi-bin/ "/var/www/html/cgi-bin/" ※CGIのディレクトリを変更
#
# "/var/www/cgi-bin" should be
changed to whatever your ScriptAliased
# CGI directory exists, if you have that
configured.
#
<Directory "/var/www/html/cgi-bin"> ※ディレクトリを変更
AllowOverride All ※変更
Options IncludesNoExec ExecCGI FollowSymLinks ※変更
Order allow,deny
Allow from all
</Directory>
#AddDefaultCharset UTF-8 ※文字化け対策でコメントアウト
AddHandler cgi-script .cgi .pl ※CGIiの有効化とPL拡張子の追加
上書き保存して終了!
WEBサーバを起動させます!
# /etc/rc.d/init.d/httpd start
サーバ起動時WEBサーバが自動起動するように設定します!
# setup
lqqqqqqqqqu ツールを選択 tqqqqqqqqqk
x Authentication configuration
x Firewall configuration
x Mouse configuration
x Network configuration
x System services ※システムサービスを選択
x lqqqqqqqqqqqqk lqqqqqqk
x x 実行ツール x x 停止 x
x mqqqqqqqqqqqqj mqqqqqqj
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
lqqqqqqqqqqqqqqqqqqu サービス tqqqqqqqqqqqqqqqqqqqk
x 自動的に起動させるサービスを指定してください。
x [ ] dhcrelay
x [ ] echo
x [ ] echo-udp
x [ ] gpm
x [*] httpd ※httpdを選択
x [*] iptables
x [ ] irda
x [ ] irqbalance
x lqqqqk lqqqqqqqqqqk
x x OK x x 取り消し x
x mqqqqj mqqqqqqqqqqj
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
/var/www/html/のオーナーとパーミッションを変更!
※ユーザ権限FTPで更新できるようにする為
# chown kawasemi /var/www/html/ ※オーナーを変更
# chmod 711 /var/www/html/ ※パーミッションを変更
以上で”自宅サーバ”でWEB公開できるようになります!
次にユーザディレクトリで公開できるようにします!
VIにて設定ファイルを変更します!
# vi /etc/httpd/conf/httpd.conf
# UserDir disable ※コメントアウトします
UserDir public_html ※コメント解除
<Directory /home/*/public_html> ※コメント解除
AllowOverride All ※ここから2行を変更
Options IncludesNoExec ExecCGI FollowSymLinks
<Limit GET POST OPTIONS> ※ここからコメント解除
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
WEBサーバを再起動!
# /etc/rc.d/init.d/httpd restart
使用するユーザを追加します!
# useradd kawasemir
# passwd kawasemi ※パスワードを設定
Changing password for user kawasemi.
New password:
Retype new password:
passwd: all authentication tokens updated
successfully.
# chmod 711 /home/kawasemi/ ※パーミッションを変更
# mkdir /home/kawasemi/public_html ※公開するディレクトリを作成
# chown kawasemi:kawasemi /home/kawasemi/public_html/ ※オーナーを変更
# chmod 755 /home/kawasemi/public_html/ ※パーミッションを変更
以上でユーザディレクトリでWEB公開できるようになります!
ルータの80番ポートを開ける事をお忘れなく・・・!