Net/apache2
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#topicpath
/////////////////////////////////////////////////////////...
* 目次 [#mb1b08f6]
#contents();
/////////////////////////////////////////////////////////...
* 設定 [#a7da24d1]
//=======================================================...
** 設定を変更した時は [#p4973393]
- 再起動が必要になる。
# /etc/init.d/apache2 restart
//=======================================================...
** 設定の確認 [#p208b5c3]
- モジュールは以下を見れば確認出来る:
++ 有効になっているモジュールは /etc/apache2/mods-enabled
++ 利用可能なモジュールは /etc/apache2/mods-available
/////////////////////////////////////////////////////////...
* ユーザディレクトリ [#l9799c4f]
- 各ユーザの特定の名前のパスが、apacheにより公開されるよ...
- 各ユーザの ${HOME}/public_html/ が、 http://hostname/~u...
- userdir モジュールを使用する。
- 有効化
# a2enmod userdir
/////////////////////////////////////////////////////////...
* CGI [#a363a7ce]
//=======================================================...
** CGIの有効化 [#yc21c632]
- まず、*.cgiや *.pl をCGIとして扱わせるようにする
# vi /etc/apache2/mods-available/mime.conf
# AddHandler allows you to map certain file extensions t...
# actions unrelated to filetype. These can be either bui...
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" ...
#
AddHandler cgi-script .cgi .pl # ←コメントアウトを外し...
- CGIプログラム用の特別なディレクトリを用意する場合は、 A...
# vi /etc/apache2/sites-available/default
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
- 各ユーザディレクトリ内にて、cgi-bin ディレクトリ内だけ...
# vi /etc/apache2/mods-available/userdir.conf
<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root
<Directory /home/*/public_html> # ← 各ユーザの ${...
AllowOverride FileInfo AuthConfig Limit I...
Options MultiViews Indexes SymLinksIfOwne...
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
# ↓以下3行を追記する
<Directory /home/*/public_html/cgi-bin>
Options +ExecCGI
</Directory>
</IfModule>
- /etc/apache2/sites-enabled/000-default.conf の編集
<VirtualHost *:80>
と
</VirtualHost>
の間に、以下を追記する:
<Directory "/var/www/html">
AllowOverride All
Options +ExecCGI
Require all granted
</Directory>
- 以下のコマンドを実行
# a2enmod cgid
# /etc/init.d/apache2 restart
//=======================================================...
** CGIの設置 [#o9aa07cf]
- パーミッションは r+x 属性が付いてないと動かないようだ。...
-- パーミッションが合ってないと、 /var/log/apache2/error....
[Sun May 05 15:01:07 2013] [error] [client 127.0.0.1] Ca...
/////////////////////////////////////////////////////////...
* SSI [#efc22ad3]
終了行:
#topicpath
/////////////////////////////////////////////////////////...
* 目次 [#mb1b08f6]
#contents();
/////////////////////////////////////////////////////////...
* 設定 [#a7da24d1]
//=======================================================...
** 設定を変更した時は [#p4973393]
- 再起動が必要になる。
# /etc/init.d/apache2 restart
//=======================================================...
** 設定の確認 [#p208b5c3]
- モジュールは以下を見れば確認出来る:
++ 有効になっているモジュールは /etc/apache2/mods-enabled
++ 利用可能なモジュールは /etc/apache2/mods-available
/////////////////////////////////////////////////////////...
* ユーザディレクトリ [#l9799c4f]
- 各ユーザの特定の名前のパスが、apacheにより公開されるよ...
- 各ユーザの ${HOME}/public_html/ が、 http://hostname/~u...
- userdir モジュールを使用する。
- 有効化
# a2enmod userdir
/////////////////////////////////////////////////////////...
* CGI [#a363a7ce]
//=======================================================...
** CGIの有効化 [#yc21c632]
- まず、*.cgiや *.pl をCGIとして扱わせるようにする
# vi /etc/apache2/mods-available/mime.conf
# AddHandler allows you to map certain file extensions t...
# actions unrelated to filetype. These can be either bui...
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" ...
#
AddHandler cgi-script .cgi .pl # ←コメントアウトを外し...
- CGIプログラム用の特別なディレクトリを用意する場合は、 A...
# vi /etc/apache2/sites-available/default
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
- 各ユーザディレクトリ内にて、cgi-bin ディレクトリ内だけ...
# vi /etc/apache2/mods-available/userdir.conf
<IfModule mod_userdir.c>
UserDir public_html
UserDir disabled root
<Directory /home/*/public_html> # ← 各ユーザの ${...
AllowOverride FileInfo AuthConfig Limit I...
Options MultiViews Indexes SymLinksIfOwne...
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
# ↓以下3行を追記する
<Directory /home/*/public_html/cgi-bin>
Options +ExecCGI
</Directory>
</IfModule>
- /etc/apache2/sites-enabled/000-default.conf の編集
<VirtualHost *:80>
と
</VirtualHost>
の間に、以下を追記する:
<Directory "/var/www/html">
AllowOverride All
Options +ExecCGI
Require all granted
</Directory>
- 以下のコマンドを実行
# a2enmod cgid
# /etc/init.d/apache2 restart
//=======================================================...
** CGIの設置 [#o9aa07cf]
- パーミッションは r+x 属性が付いてないと動かないようだ。...
-- パーミッションが合ってないと、 /var/log/apache2/error....
[Sun May 05 15:01:07 2013] [error] [client 127.0.0.1] Ca...
/////////////////////////////////////////////////////////...
* SSI [#efc22ad3]
ページ名: