Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can somebody please help me to avoid internal server error | htaccess | apache2ctl | backtrack

Im new to stackowerflow as well as apache and im sorry if i have placed this thread in a wrong place..

Can somebody please help me to avoid internal server error | htaccess | apache2ctl | backtrack

What i wanted to do was to add these lines to htaccess.. My htaccess and webserve is working fine without these lines.. but i need to add them to the htaccess

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

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

as soon as i enter above lines it gives me this error when i refresh 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

Can somebody kindly give some advice please? any help would be highly appreciated...

like image 996
Aravinda Avatar asked Dec 16 '13 13:12

Aravinda


People also ask

Why does it keep saying internal server error?

The HyperText Transfer Protocol (HTTP) 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. This error response is a generic "catch-all" response.

Is 500 internal server error hack?

Clear the browser cache: If you have entered the web several times and the only thing that shows you internal error server 500 for a long time, it is possible that you have the web cached in your browser, so try to enter incognito or delete the cache from your browser.

Why do I get 500 internal server error?

The 500 Internal Server error could be caused by an error during the execution of any policy within Edge or by an error on the target/backend server. The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request.


1 Answers

First of all, you need to enable the needed apache modules:

a2enmod rewrite headers

Then, in apache configuration, you can execute only if the needed module is enabled:

 <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>

Restart your Apache server:

service apache2 restart

If still have an error do:

tail /var/log/apache2/error.log

You'll see the detailed error.

like image 182
Manolo Avatar answered Nov 10 '22 00:11

Manolo