• ベストアンサー

apacheとCGIの設定(httpd.conf)について

Apache/1.3.26を使用しています。 CGIの定義の中に Alias /cgi-bin/ /usr/lib/cgi-bin <Directory /usr/lib/cgi-bin/> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> があるのですがこれは何を定義しているのでしょうか? また、ある指定のフォルダ /var/www/cgi-bin だけ CGI設置可能にするにはどうすればよいでしょうか?

質問者が選んだベストアンサー

  • ベストアンサー
  • stinger7
  • ベストアンサー率50% (1/2)
回答No.1

>Alias /cgi-bin/ /usr/lib/cgi-bin http://localhost/cgi-bin/ =>/usr/lib/cgi-bin/ >AllowOverride None overrideを認めるか? 否。(.htaccessがきかなくなる?) >Options ExecCGI CGI可能 >Order allow,deny allowとdenyを定義 >Allow from all allからの接続を許可。 >これは何を定義しているのでしょうか? /usr/lib/cgi-bin/についての定義と考えていいのでは >/var/www/cgi-bin だけCGI設置可能にするには Alias /cgi-bin/ /var/www/cgi-bin <Directory /var/www/cgi-bin/> ~~~~自分の設定~~~~ </Directory> とされたらどうでしょうか。

apache6
質問者

お礼

詳しい説明ありがとうございます。 おかげでhttpd.confの記述が分かった気がします。

関連するQ&A

  • ApacheのScriptAliasについて

    ScriptAlias /cgi-bin/ /var/www/cgi-bin/ ScriptAlias /cgi-bin/ /home/*/public_html/cgi-bin/ # # "/usr/lib/cgi-bin" could be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory /var/www/cgi-bin/> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> <Directory /home/*/public_html/cgi-bin> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> 何がやりたいかと言うと複数箇所でcgi-binを作ってCGIをうごかせるようにしたいのですが、ScriptAliasは複数指定ってできるのでしょうか? できなければ何かうまい方法はないでしょうか?よろしくお願いしますm(_ _)m

  • apacheのCGI設定

     pc9821にFreeBSD(98)をいれapache1.3を起動させています。cgiはlight.cgiというソフトをつかっています。なかなかcgiがうまくいきません。参考ページには public_html / index.html (トップページ) | +-- bbs / light.cgi [755] | admin.cgi [755] ・・・・(省略) +-- lock [777] / | +-- past [777] / 0001.cgi [666] とかかれていますが、実際に私のサーバーにはpublic_htmlというフォルダは存在していなくて /usr/local/www/cgi-binにbbsというフォルダをつくり あとは上のようにしています。またindex.htmlは/usr/local/www/dataのなかにいれて表示してWebサーバーとしてはたらいています。またapacheの/usr/local/etc/apacheのhttpd.confは 関係ありそうな行だけあげると ServerRoot "/usr/local" DocumentRoot "/usr/local/www/cgi-bin" <Directory "/usr/local/www/cgi-bin/bbs"> Options Indexes FollowSymLinks MultiViews <location "/cgi-bin/"> Options ExecCGI AllowOverride AuthConfig Limit Order allow ,deny Allow from all </Location> <IfModule mod_mime.c> TypesConfig /usr/local/etc/apache/mime.types ADDHandler cgi-script .cgi </IfModule> ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/" <Directory "/usr/local/www/cgi-bin/bbs"> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> AddHandler cgi-script .cgi どこがおかしいのかおしえていただけないでしょうか?

    • ベストアンサー
    • CGI
  • cgi-binにアクセスできない

    apache初心者です。 Turbolinux6.0+apache1.3.12でHTTPサーバを試しているのですが、 cgi-binにあるファイルを見ようとするとHTTP 403エラーが出て表示できません。 属性とグループを色々変えてみたんですが、だめでした。 access.confで関係ありそうな所は <Directory /> Options None AllowOverride None order allow,deny allow from all </Directory> <Directory /home/httpd/html> Options Indexes Includes FollowSymLinks AllowOverride None order allow,deny allow from all </Directory> <Directory /home/httpd/cgi-bin> AllowOverride None Options FollowSymlinks ExecCGI order allow,deny allow from all </Directory> としていますが、なぜcgi-binの中身が見えないのかわかりません。 よろしくおねがいします。

  • /cgi-bin/のファイル読み出し

    WindowsXPでApacheをlocalhostで使用しています。 httpd.confを以下のように設定してcgiは問題なく作動していますが、/cgi-bin/に置いた画像やhtmlが読み出せません (すなわちhttp://localhost/cgi-bin/にアクセス出来ず、Forbiddenのエラーが出ます) 今は仕方なく、cgiで使用するファイルや画像をDocumentRoot配下に置いていますが、/cgi-bin/配下のファイルを読み出すhttpd.confの設定を教えて下さい。 DocumentRoot "F:/" <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory "F:/"> AllowOverride None Order allow,deny Allow from all </Directory> <IfModule mod_alias.c> ScriptAlias /cgi-bin/ "F:/cgi-bin/" <Directory "F:/cgi-bin"> AllowOverride None Options ExecCGI MultiViews Order allow,deny Allow from all </Directory> </IfModule>

  • cgi-binディレクトリ内のhtmlを有効にしたい

    度々お騒がせしております。 本日は、Apacheの設定について 伺いたく投稿させていただきました。 apacheの設定を終え、 一通り動作するようにできたのですが、 cgi-binディレクトリに置いたhtmlや jpg,gifといったcgi以外のファイルが 表示されません。 httpd.confによる cgi-binディレクトリの設定でどうにかなるものと思い、 色々調べてみたのですが、 いまいち設定方法がわかりません。 以下、私の環境です。 Apacche 1.3.20 htmlディレクトリ /var/www/html/ (775) cgi-binディレクトリ /var/www/html/cgi-bin/ (775) 現在のcgi-binディレクトリの設定 ScriptAlias /cgi-bin/ "/var/www/html/cgi-bin/" <Directory "/var/www/cgi-bin"> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> 以上、どうかよろしくお願いいたします。

  • httpd.confを添削してください!!(長文)

    こんにちわ いろいろと調べながらhttpd.confを自分の理想の動作を得るたねに設定したつもりです。 添削をお願いします。 /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ DocumentRoot /var/www/html <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory "/var/www/html"> #←home Options FollowSymLinks Includes AllowOverride All Order allow,deny Allow from all </Directory> #.htaccessを許可、cgiは不可、ssiは許可、シンボリックリンク許可 Order~略 <IfModule mod_userdir.c> UserDir public_html </IfModule> <Directory /home/*/public_html> AllowOverride AuthConfig Limit Options +ExecCGI +Includes </Directory> #ユーザー領域では.htaccessで認証、アクセス元などで制御の許可。 それ以外は不可。 homeでcgiが不可ですがここでは許可したいので+を付けた。 <Directory "/var/www/cgi-bin"> AllowOverride All Options ExecCGI Order allow,deny Allow from all AddHandler image .gif .jpg AddHandler text/html .htm .html </Directory> /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ こんな感じなんですがどこかおかしいでしょうか?

  • apacheによるCGIの使用について

    極めて初歩的な質問かも知れませんが、ご回答頂けると幸いです。 現在、私は玄箱(非HG)を使用して、apache1によるホームページを開いています。OSはMontaVista LinuxとDEBIANの二種類を使用しているのですが、MontaVistaLinuxの方で稼動しているapacheでは、正常にCGIが使えるのに対し、DEBIANの方では、MontaVistaLinuxと全く同じバージョンのapacheを使用し、CGIの設定も全く同じ状態であるにも関わらず、何故かCGIが使用できません。必ずInternalServerErrorとなってしまいます。何度もCGIの設定を見直したのですが、どうしてもDEBIANにインストールしたapacheではCGIが使えませんでした。DEBIANでapacheは使用できないのでしょうか? 現在のCGIに関する設定は以下のようになっています。 <IfModule mod_alias.c> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ # # "/usr/lib/cgi-bin" could be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory /usr/lib/cgi-bin/> AllowOverride None Options None Order allow,deny Allow from all </Directory> </IfModule> また、AddHandler cgi-script .cgiの行はコメントアウトしています。 参考サイト:http://www5.plala.or.jp/vaio0630/apache/apache_cgi.htm DEBIANでapacheが使用できないとは思えないのですが、現実に使用できず、とても悔しいです。 もしDEBIANにインストールしたapacheでCGIを使える方がいましたら、どのような設定をすればCGIが動くのかを教えていただけると幸いです。 どうぞ宜しくお願い致します。

  • apacheで「You don't have permission to access 」

    Nagiosというソフトをインストールしているのですが(Webベースで動く)、 http://localhost/nagios にアクセスすると、「You don't have permission to access /nagios/ on this server.」と出てしまいます。Apacheのhttpd.confは最後の行に、 ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin <Directory "/usr/local/nagios/sbin"> AllowOverride AuthConfig Options ExecCGI Order allow,deny Allow from all </Directory> Alias /nagios /usr/local/nagios/share <Directory "/usr/local/nagios/share"> Options None AllowOverride AuthConfig Order allow,deny Allow from all </Directory> を加えて、以下も加えました。 <Directory /> Options FollowSymLinks AllowOverride Options </Directory> AddHandler cgi-script .cgi 何か原因は考えられるでしょうか?これだけではやはり、情報不足でしょうか?

  • apacheのScriptAliasの記述について

    どなたか,ご教授いただければ幸いです。 WindowsXp Proでapacheを動かしています。次の設定で,cgiはうまく動作していました。 --- <IfModule alias_module> ScriptAlias /cgi-bin/ \"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/\" </IfModule> <Directory \"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin\"> AllowOverride None Options ExecCGI Order allow,deny Allow from all AddHandler image/gif .gif AddHandler image/jpeg .jpg </Directory> --- これに, http://www.miloweb.net/win/server/apache.html を参考にして,各ユーザーフォルダでcgiが実行できるようにしようと,次のようにしました。 --- <IfModule alias_module> ScriptAlias /cgi-bin/ \"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/\" ScriptAlias /cgi/ \"C:/www/users/*/cgi/\" </IfModule> <Directory \"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin\"> AllowOverride None Options ExecCGI Order allow,deny Allow from all AddHandler image/gif .gif AddHandler image/jpeg .jpg </Directory> <IfModule mod_userdir.c> UserDir \"C:/www/users/*/\" </IfModule> <Directory \"C:/www/users/*/cgi/\"> AllowOverride None Options ExecCGI Order allow,deny Allow from all AddHandler image/gif .gif AddHandler image/jpeg .jp </Directory> --- その結果, http://localhost/~user/ としてuserのホームページにアクセスできるようになったのですが, cgiについては, http://localhost/~user/cgi/・・・ としてもアクセスできません。どなたか原因をご教授いただけないでしょうか。 ScriptAlias /cgi-bin/ \"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/\" ScriptAlias /cgi/ \"C:/www/users/*/cgi/\" の行を入れ替えると,\"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/\"においてあるcgiが実行できなくなります。ScriptAliasは1行目しか有効でないようにも見えるのですが,上に書いた参考URLではできているようなので,戸惑っています。

  • apache2.2の設定について

    あるディレクトリでsite_available中のファイルの設定が <Directory /var/hogehoge> Options ExecCGI -FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> となっているのですが、現在このhogehoge中のディレクトリでimageというディレクトリに置かれたgifファイル(すなわちvar/hogehoge/image/○○○.gif)をcgiとして認識されています。 これを回避するためにimage以下の場合はcgiではなくgifで認識させるようにしたいのですが、どうすればよいのでしょうか? apacheはdebian系のapache2.2系です。 宜しくお願い致します。