LoginSignup
6
10

More than 5 years have passed since last update.

ssi有効化

Last updated at Posted at 2016-06-09

ssi有効化設定

ssiが有効化せず、htmlファイル内のinclude virtual記述でヘッダやフッダがインクルードされなかった。

httpd.confに追加

LoadModule include_module modules/mod_include.so

'<'Directory /var/www/>www以下全てに適応させる
  Options Includes FollowSymLinks
  AllowOverride none
  Require all granted
  AddType text/html .html
  AddOutputFilter INCLUDES .html
'<'/Directory>

上から、

  • LoadModule include_module modules/mod_include.so(インクルードモジュールを読み込ませる。)
  • Options Includes FollowSymLinks(シンボリックリンクの有効化。シンボリックリンクが設定されている場合apacheはそれを辿る。)
  • AllowOverride none(.htaccessファイルでは何も設定できない※Allはhtaccessファイルの設定が全て有効化される。)
  • Require all granted(アクセス許可の設定) 以前の書き方は、 Order allow,deny Allow from all だったのが、apache2.4からは、 Require all granted の一文のみ。 こんな基本的な設定方法もかわっている。
  • AddType text/html .html(mimeタイプの追加。)
  • AddOutputFilter INCLUDES .html(インクルードを有効化することによってssiが有効化される。)

これでssiが有効化し、ヘッダフッダが出現した。

6
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
10