Apacheの2系でSSIの設定をする

いまどきSSIを使う機会も少ないですが

たまたま設定することになったのでそのときのメモ。

apacheは2.2系(RPM)です。(1.3系ではおそらく異なります。)

具体的にはhttpd.confの設定します。

まず、次の2行があることを確認(ない場合は追加!)

AddType text/html .shtml
AddHandler server-parsed .shtml

そして、SSIを使いたいディレクトリのDirectoryディレクティブ内を次のようにIncludesを追加。

<Directory /yourdirectory>
   AllowOverride All
   Options FollowSymLinks Includes
   Order allow,deny
   Allow from all
</Directory>

最後に、DirectoryIndexにindex.shtmlを追記

以上でapacheを再起動して動作確認をしてみてください。

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

© PHPress since 2008