|
Contributed at: 2004/11/15 (Mon) 17:27
|
初期状態では CGI は実行出来ない(正確には ScriptAlias の指定がされている /var/www/cgi-bin 以外では)。
ドキュメント・ルート(/var/www/html) でファイル拡張子 .cgi を CGI として実行させるためには httpd.conf の変更が必要。
設定ファイル『 /etc/httpd/conf/httpd.conf 』の編集。
304 行目に【 ExecCGI 】を追加。
<Directory "/var/www/html"'>
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks ExecCGI
引き続き 807 行目のコメント・アウト(コメント=無効にされているのを解除)
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# 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" directive.)
#
AddHandler cgi-script .cgi
# diff -u httpd.conf.2004-1115b httpd.conf
--- httpd.conf.2004-1115b 2004-11-15 15:41:27.000000000 +0900
+++ httpd.conf 2004-11-15 16:53:39.203692024 +0900
@@ -301,7 +301,7 @@
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
#
- Options Indexes FollowSymLinks
+ Options Indexes FollowSymLinks ExecCGI
#
# AllowOverride controls what directives may be placed in .htaccess files.
@@ -804,7 +804,7 @@
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
-#AddHandler cgi-script .cgi
+AddHandler cgi-script .cgi
#
# For files that include their own HTTP headers:
終わったら apache 再起動をして設定反映。
# /etc/rc.d/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]
[分類 /linux/FedoraCore3 ]
固定リンク
| |
|