• 締切済み

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> /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ こんな感じなんですがどこかおかしいでしょうか?

みんなの回答

  • kalze
  • ベストアンサー率47% (522/1092)
回答No.1

>自分の理想の動作を得るたねに設定したつもりです ということですが、 その自分の理想の動作は? それがわからないと添削もなにもないでしょう。 誰かから見ておかしいとおもっても、貴方のやりたいことをするにはそれでいいのかもしれない。 こういう動作をさせたいと思ったので、 上記のような設定にしましたが、 おかしいところなどありませんか? というならhttpd.confが分かる人がアドバイスをしてくれるとおもいますが

関連するQ&A

  • Redhat9のHTTPDでCGIがつかえない

    まずやりたい事はユーザーごとにWEBができるようにして、CGIをpublic_html以下のどこにでもCGIが使えるようにしたい思っています。 いろんなサイトを見てhttpd.confをいじってますが、どうしてもCGIを実行しても500エラーがでます。perlの場所はあっているんですが。 httpd.confのいじった所は、 <IfModule mod_userdir.c> UserDir public_html </IfModule> と <Directory /home/*/public_html> AllowOverride FileInfo AuthConfig Limit Options IncludesNoExec ExecCGI FollowSymLinks <Limit GET POST OPTIONS> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS> Order deny,allow Deny from all </LimitExcept> </Directory> と ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"をコメントアウトしました。もしよろしければご指導のほどよろしくおねがいします。

  • 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設置可能にするにはどうすればよいでしょうか?

  • 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ではできているようなので,戸惑っています。

  • Fedora Apache ユーザディレクトリの設定 /をつけないと表示されない!

    Fedora CoreのApacheでユーザディレクトリのコンテンツを公開するため、下記のように設定しました。 <IfModule mod_userdir.c> UserDir public_html </IfModule> <Directory /home/*/public_html> AllowOverride All Options IncludesNoExec ExecCGI FollowSymLinks <Limit GET POST OPTIONS> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS> Order deny,allow Deny from all </LimitExcept> </Directory> で、ばっちり見れるようになったんですが、下記のような問題が残っています。 http://ホストアドレス/~ユーザ名/ では正常に表示されるが、 http://ホストアドレス/~ユーザ名 のようにスラッシュを省略すると、表示されない。 ご存知の方おられましたらよろしくお願いしますー!

  • Apach2.0 ホームディレクトリでCGIが

    こんにちは。 CGIの勉強をしています。 わかる方がいらっしゃいましたら、おしえてください。 ソースは、poderosaでつないでviにて作成。 ブラウザからのアクセス http://XXX.XXX.XXX.XXX/~admin/cgi-bin/test.cgi (test.cgi)755 #!/usr/bin/perl print "Content-type: text/html\n\n"; print "Hello\n"; ./test.cgi にて、Helloと表示される (httpd.confに追加したもの) UserDir public_html <Directory /home/*/public_html> AllowOverride All Options IncludesNoExec ExecCGI FollowSymLinks <Limit GET POST OPTIONS> Order allow,deny Allow from all </Limit> <LimitExcept GET POST OPTIONS> Order deny,allow Deny from all </LimitExcept> </Directory> 以下を追加したこともあり↓ <Directory /home/*/public_html/cgi-bin/> AllowOverride None Options ExecCGI SetHandler cgi-script Order allow,deny Allow from all AddHandler cgi-script .cgi </Directory> よろしくおねがいします。

  • 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の中身が見えないのかわかりません。 よろしくおねがいします。

  • .httpd.confの記述方法

    いつもお世話になります。 <!--#exec cmd="TEST.CGI"-->が使用できないため、httpd.confを 見直していたところ下記記述になっておりました。 371行目にOptions All、372行目にOptions Indexes MultiViews SymLinksIfOwnerMatchの記述があります。 2行続けてOptionsの記述がある場合動作はどうなるのでしょうか? どちらか削除した方がよろしいですよね。 お恥ずかしいのですが、ご回答お願いいたします。 -------------------------------------------- #<Directory /home/*/www> 357 # AllowOverride FileInfo AuthConfig Limit 358 # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec 359 # <Limit GET POST OPTIONS PROPFIND> 360 # Order allow,deny 361 # Allow from all 362 # </Limit> 363 # <LimitExcept GET POST OPTIONS PROPFIND> 364 # Order deny,allow 365 # Deny from all 366 # </LimitExcept> 367 #</Directory> 368 369 <Directory /home/*/www> 370 AllowOverride All 371 Options All 372 Options Indexes MultiViews SymLinksIfOwnerMatch ExecCGI Includes 373 </Directory>

  • /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を設置

    ユーザー毎のディレクトリでCGIを設置可能にしようとしているのですが、うまくいきません。 教えて下さい。 【環境】 Apache/2.0.40 Red Hat Linux 8.0 【httpd.confの設定抜粋】 DocumentRoot "/home/homepage/public_html" <Directory /home/homepage/public_html> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <IfModule mod_userdir.c> UserDir public_html </IfModule> <Directory /home/*/public_html> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> #ScriptAlias /cgi-bin/ "/home/homepage/public_html/cgi-bin/" 【.htaccessの設定】 AddHandler cgi-script .cgi Options +ExecCGI 以上のような設定で #!/usr/bin/perl print "Content-type: text/html\n\n"; print "hello"; こんなCGIをつくって実行してみました。 /home/homepage/public_html/cgi-bin/においたものはうまくいくのですが /home/user/public_html/cgi-bin/においたものはエラーになってしまいます。 エラーの内容は↓のとおりです。 Server error! The server encountered an internal error and was unable to complete your request. Error message: Premature end of script headers: hello.cgi If you think this is a server error, please contact the webmaster Error 500 perlのパスは間違ってないし、パーミッションも755にしてあります。 どうすればいいのか分からず困っています。 どこを調べれみればいいのかだけでも教えていただけると助かります。 よろしくお願いします。

  • 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系です。 宜しくお願い致します。