2011-09-18 3 views
0

が含まれています。私は適切にSSIをオンにしていると思いますサーバー側では、私は、Apacheのログに次のエラーメッセージが表示されました

<!--#include virtual="header.html" --> 

:私は(ドキュメントルートに配置されているheader.htmlhomepage.shtml両方)homepage.htmlに非常に基本的なディレクティブを使用しました私のhttpd.conf

Options Indexes FollowSymLinks ExecCGI Includes 
... 
AddType text/html .shtml 
... 
# XBitHack doesn't have anything to do with this, but I added it anyway. 
XBitHack on 

は、私は何を欠場しましたか?含まれているファイル、すなわちheader.htmlの設定が異なる必要がありますか?

+1

あなたは、ファイルSHTMLを命名しましたときにXBitHackは必要ありません。 header.htmlがshtmlのようなディレクトリにある場合は、<! - #include file = "header.html" - > –

+0

try virtual = "/ header.html"としてください。さもないと;エラーは権限エラーを示唆しているようです。 header.htmlを実行可能でないようにchmodしてみてください。 – Gerben

+0

残念ながら、これらの2つの提案は機能しませんでした。 – moey

答えて

0

私はこの問題を、apache2を使用して11.10のubuntuで直接修正しました。

私の/ etc/apache2の/サイト利用可能/デフォルトファイル:

<VirtualHost *:80> 
    ServerAdmin [email protected] 

    DocumentRoot /var/www 
    <Directory /> 
      Options FollowSymLinks 
      AllowOverride None 
    </Directory> 
    <Directory /var/www/> 
      Options Indexes FollowSymLinks MultiViews 
      AllowOverride All 
      Order allow,deny 
      allow from all 
    </Directory> 

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ 
    <Directory "/usr/lib/cgi-bin"> 
      AllowOverride None 
      Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch 
      Order allow,deny 
      Allow from all 
    </Directory> 

    ErrorLog ${APACHE_LOG_DIR}/error.log 

    # Possible values include: debug, info, notice, warn, error, crit, 
    # alert, emerg. 
    LogLevel warn 

    CustomLog ${APACHE_LOG_DIR}/access.log combined 

Alias /doc/ "/usr/share/doc/" 
<Directory "/usr/share/doc/"> 
    Options Indexes MultiViews FollowSymLinks 
    AllowOverride None 
    Order deny,allow 
    Deny from all 
    Allow from 127.0.0.0/255.0.0.0 ::1/128 
</Directory> 

</VirtualHost> 

私はすべてでは/ var/wwwディレクトリディレクティブにAllowOverrideのなしに変更されません。

/var/www/.htaccessの私の.htaccessファイル:

Options +Includes 
AddType text/html .shtml 
AddOutputFilter INCLUDES .shtml 

は最終的に私はinclude.loadが、これはmod_includes.soモジュールをロードすることです改造対応のフォルダにあったことを確認しました。

sudo ln -s /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled/include.load 

これにより、mods-availableのinclude.loadへのシンボリックリンクが作成されます。

は最終的に、それは私のために働く作っapacheの

sudo service apache2 restart 

を再起動して、あなたはそれが同様に働いてもらう願っています。

- トーマス

+0

注:ubuntu/debian apache2の設定パターンは、apache2とは異なります。これは何かが設定されている方法に大きな違いをもたらす可能性があります:http://www.control-escape.com/web/configuring-apache2-debian.html –

関連する問題