07/12/06 23:19:49 Hw5oiRQ3
すいません。mod_perl2とapache2でサイト構築してるんですが、
以下のことを実現したく設定していますがうまくいきません。
識者の方お助けを。
■やりたいこと
/cgi-bin/XXX/でアクセスされたときに、DirectoryIndexでindex.cgiに振りたい。
index.cgiはmod_perl2で動作させたい。
■設定1
DirectoryIndex index.cgi #ファイル指定なしはindex.cgiへ
Alias /cgi-bin/XXX/ "/home/aaa/cgi-bin/"
<DirectoryMatch "/home/aaa/cgi-bin/(.*.cgi)">
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options ExecCGI +MultiViews
</DirectoryMatch>
■動作1
URLリンク(localhost)でアクセス。
ブラウザ:
403(forbidden)
エラーログ:
Options ExecCGI is off in this directory: /home/aaa/cgi-bin/index.cgi
つづく
581:580
07/12/06 23:20:21 Hw5oiRQ3
つづき
--
■設定2
<Directory "/home/aaa/cgi-bin/"> <<Directoryに変更
・・中略・・
</Directory>
■動作2
URLリンク(localhost)でアクセス。
ブラウザ:
404(Not Found)
エラーログ:
Attempt to serve directory: /home/aaa/cgi-bin/
--
■設定3
設定1に以下のディレクティブを追記
<Directory "/home/aaa/cgi-bin/">
Options MultiViews FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from All
</Directory>
■動作3
URLリンク(localhost)でアクセス。
ブラウザ:
200 ただし、cgiモードとしての動作。
mod_perl2経由での動作ではない。
DirectoryIndexで指定したCGIをmod_perl2で動作させるにはどうしたらいいんでしょう?
#/XXX/index.cgiで指定した場合は設定1でmod_perl2で動作しています。
582:580
07/12/10 21:07:44 KeD/Ehfx
mod_perlすれの人に助けてもらった!
ノウハウです。。。
724 :nobodyさん [↓] :2007/12/10(月) 20:27:41 ID:??? ?2BP(1520)
add-handler あたりかな?
725 :723 [↓] :2007/12/10(月) 21:05:41 ID:???
>>724
ありがとうございます。
早速試してみたところ、無事解決しました!うおおお!
■変更前
<DirectoryMatch "/home/aaa/cgi-bin/(.*.cgi)">
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options ExecCGI +MultiViews
</DirectoryMatch>
↓
■変更後
<Directory "/home/aaa/cgi-bin/">
AddHandler perl-script .cgi
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options ExecCGI +MultiViews
</Directory>
■設定3で追記した通常のCGIで動作させるDirecitoryディレクティブは削除