|
■ httpd.confの設定
apacheをインストールしたままの状態で利用する場合、以下の説明は必要ありません。その場合のドキュメントフォルダはC:\usr\apache\htdocs、cgiはc:\usr\apache\cgi-binを使います。セキュリティに関する対策は必要です。
http.confの説明は、図に示したような階層の下で利用するものと仮定します。
説明上の数字は、httpd.conf(ver1.3.22)の行番号を表します。他バージョンでもその付近の行に有ると思います。
尚、詳細な説明については、割愛させていただきます。
変更個所を赤い文字で表しています。青い文字は、コメントを外す個所です。
●htmlフォルダの設定
index.htmlなどのドキメントを\public_htmlの下に設置するには、以下の2箇所を修正します。
301: DocumentRoot "c:/usr/Apache/htdocs"
DocumentRoot "c:/home/htdocs/public_html"
326: <Directory "c:/usr/Apache/htdocs">
<Directory "c:/home/htdocs/public_html">
●~(チルダ)の指定
http://www.huonpine/~indataのようにチルダを利用する場合は、326行のようにc:/homeまでの記述にし、360行は*のマルチ設定にします。
326: <Directory "c:/usr/Apache/htdocs">
<Directory "c:/home">
360: UserDir "c:/usr/apache/users"
UserDir "c:/home/*/public_html"
●cgi-binフォルダの設定
610: ScriptAlias /cgi-bin/ "c:/usr/apache/cgi-bin/"
ScriptAlias /cgi-bin/ "c:/home/htdocs/public_html/cgi-bin/"
616: <Directory "c:/usr/apache/cgi-bin">
<Directory "c:/home/htdocs/public_html/cgi-bin">
843: #AddHandler cgi-script .cgi
AddHandler cgi-script .cgi
●shtmlの設定
shtmlに対応させるには、次の4箇所を修正します。
335: Options Indexes FollowSymLinks MultiViews
Option Includes Indexes FollowSymLinks MultiViews
385: DirectoryIndex index.html
DirectoryIndex index.html index.shtml
848: #AddType text/html .shtml
AddType text/html .shtml
849: #AddHandler server-parsed .shtml
AddHandler server-parsed .shtml
●htaccessに対応させます。
342: AllowOverride None
AllowOverride All
以上の個所を変更する事で、取合えず動くはずです。
●cgiをcgi-bin以外で使う場合は、335行に以下のように追加します。
335: Options Indexes FollowSymLinks MultiViews
Option Indexes FollowSymLinks MultiViews
ExecCGI
●cgiをcgi-bin以外とshtmlの両方を使う場合は、次のようにAllを定義します。
335: Options Indexes FollowSymLinks MultiViews
Option All
|