6

私はstackowerflowとapacheを初めて使用し、このスレッドを間違った場所に配置した場合は申し訳ありません..

誰かが内部サーバーエラーを回避するのを手伝ってくれませんか | htaccess | Apache2ctl | バックトラック

私がやりたかったのは、これらの行を htaccess に追加することでした..私の htaccess と webserve はこれらの行がなくても正常に動作しています..しかし、それらを htaccess に追加する必要があります

RewriteEngine on
RewriteCond %{REQUEST_METHOD}^(TRACE|TRACK)
RewriteRule .* - [F]

Header set X-Frame-Options Deny
Header always append X-Frame-Options SAMEORIGIN**

上記の行を入力するとすぐに、Webを更新するとこのエラーが表示されます

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.14 (Ubuntu) Server at 192.168.176.130 Port 80

誰か親切にアドバイスをお願いできますか?どんな助けでも大歓迎です...

4

1 に答える 1

10

まず、必要な Apache モジュールを有効にする必要があります。

a2enmod rewrite headers

次に、Apache 構成で、必要なモジュールが有効になっている場合にのみ実行できます。

 <IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteCond %{REQUEST_METHOD}^(TRACE|TRACK)
   RewriteRule .* - [F]
 </IfModule>

 <IfModule mod_headers.c>
   Header set X-Frame-Options Deny
   Header always append X-Frame-Options SAMEORIGIN**
 </IfModule>

Apache サーバーを再起動します。

service apache2 restart

それでもエラーが発生する場合は、次のようにします。

tail /var/log/apache2/error.log

詳細なエラーが表示されます。

于 2013-12-16T13:20:41.903 に答える