/var/www/htmlでCGIを動かしたいのですが、
httpd.confをどうさわっても動きません。
/var/www/cgi-binでしか動作しません。
http://221b.net/httpd.txt httpd.confです。
問題点の指摘をお願いします。
/var/www/html以下を利用する場合で書いてみようと思います。
前からいきますと、
DocumentRoot /home/httpd/html
ここは、
DocumentRoot /var/www/html
の方が良いでしょう。
<Directory /> Options ExecCGI FollowSymLinks AllowOverride All </Directory>
ルートは出来れば最低限の実行になるように、
<Directory /> Options FollowSymLinks AllowOverride None Order Deny,Allow Deny from All </Directory>
等とした方が…。
<Directory /home/httpd/html> Options Indexes Includes ExecCGI FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory>
ここを、
<Directory /var/www/html> Options Indexes Includes ExecCGI FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory>
のようにして、/var/www/htmlを設定。
あと、
ScriptAlias /html/ /var/www/html
ここをコメントアウト
# ScriptAlias /html/ /var/www/html
とかでどうでしょうか…。
うまくいかないようでしたらすみません。
関係ありそうな所をザッと見てみました。
DocumentRoot /home/httpd/html <Directory /> Options ExecCGI FollowSymLinks AllowOverride All </Directory> <Directory /home/httpd/html> Options Indexes Includes ExecCGI FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> UserDir public_html ScriptAlias /html/ /var/www/html <Directory /var/www/html> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> AddHandler cgi-script .cgi .pl
これらより、
http://localhost/test.cgi でのアクセスは、/home/httpd/html/test.cgi を実行しようとします。(このディレクトリにはCGIの実行が許可されていて、○○○.cgi, △△△.pl へのアクセスは、CGI とみなされています)
http://localhost/~hoge のようなユーザ指定のアクセスは、/home/hoge へのアクセスとなります。
http://localhost/html/test.cgi へのアクセスは、/var/www/html/test.cgi を実行しようとします。
ScriptAlias /html/ /var/www/html は
ScriptAlias /html/ /var/www/html/ のように / が必要な気が...
ここまでで、
> /var/www/htmlでCGIを動かしたいのですが、
http://localhost/html/test.cgi とアクセスするという事ですよね?
この時のエラーメッセージはどう出ていますか?(ブラウザ上、Apache のエラーログ)
> /var/www/cgi-binでしか動作しません。
これは、どのようにアクセスしましたか?(単純にはこのディレクトリに到達出来な気がするので)
また、その時のログは?
動作する時の httpd.conf は、http://221b.net/httpd.txt の内容ですか?
CGIを動かす時には以下を参考にしました。
http://httpd.apache.org/docs/2.2/ja/howto/cgi.html#troubleshoot
コメント(0件)