chibi style
    

Home > Debian > Webサーバ > SSIを利用できるようにする

SSIを利用できるようにする

SSIを利用できるようにする為、モジュールを読み込ませる

# a2enmod
Which module would you like to enable?
Your choices are: actions asis auth_anon auth_dbm auth_digest auth_ldap cache cern_meta cgi cgid dav
dav_fs deflate disk_cache expires ext_filter file_cache headers imap include info ldap mem_cache mime_magic 
php4 proxy proxy_connect proxy_ftp proxy_http rewrite speling ssl suexec unique_id userdir usertrack vhost_alias
Module name? include	←includeと入力
Module include installed; run /etc/init.d/apache2 force-reload to enable.


次に/etc/apache2/apache2.confを編集する

# vi /etc/apache2/apache2.conf
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml	←202行目
↓
DirectoryIndex index.html index.shtml index.cgi index.pl index.php index.xhtml	←index.shtmlを追加

以下はデフォルトで記述されているが、無い場合には追加しておく
<FilesMatch "\.shtml(\..+)?$">
    SetOutputFilter INCLUDES
</FilesMatch>


/etc/apache2/sites-available/defaultのOptionsの項目でSSIが利用できるように記述する。
このdefaultファイルはメインのページ用の設定ファイルであり、バーチャルホストで複数のページを
使い分けている場合でSSIを利用する場合には、その設定ファイルにも記述する必要がある

# vi /etc/apache2/sites-available/default
Options ExecCGI FollowSymLinks
↓
Options IncludesNoExec ExecCGI FollowSymLinks

IncludesNoExecはexecを許可しない。execも許可したい場合はIncludesとする


以上が終わったらApacheを再起動しておく

# /etc/init.d/apache2 restart


>>このページのTOPへ

最終更新 : 09/26/2005


Copyright © 2004-2007 chibi ,All Rights Reserved