サーバー設定  http://kwne.jp/

[サーバー設定に戻る]
 ■ APACHE2の設定

apache2の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
     ※CGIの有効化とPL拡張子の追加


WEBサーバの起動

# /etc/rc.d/init.d/httpd start

自動起動

# 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/
    ※パーミッションを変更


ユーザディレクトリ公開

# 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 -s /sbin/nologin kawasemi

# 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/   
※パーミッション変更

ルータの80番ポートを開ける事

▲このページのトップへ戻る


Copyright(c) KWNE All rights reserved.
リンクフリーです(連絡不要)