Ask Your Question

Unable to start Apache Server-Error in RewriteEngine

asked 2013-03-14 00:15:44 -0500

SocialQA's avatar

updated 2013-03-15 22:25:48 -0500

I have used the code provided in the deployment section of the documentation, all I have done is change the directly to match with my setup but when start the apache server it fails at line RewriteEngine on

Here is the section:

 RewriteEngine on `this is the line with error`
     RewriteRule /admin(.*)$ https://MY-IP-ADDRESS/admin$1 [L,R=301]
 CustomLog /var/log/httpd/askbot/access_log common
 ErrorLog /var/log/httpd/askbot/error_log
 LogLevel debug

Here is the error:

* Starting web server apache2                                                                                     Syntax error on line 38 of /etc/apache2/sites-enabled/askbot:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'start' failed.
The Apache error log may have more information.

also I am not sure how to configure following two lines:

#WSGISocketPrefix /path/to/socket/sock
#WSGIPythonEggs /var/python/eggs
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-03-15 17:00:58 -0500

Felix Schwarz's avatar

Looks like you don't have mod_rewrite enabled. Probably you're on Debian or Ubuntu which have a pretty modular Apache so you need to check if you actually installed the necessary module.

On CentOS there is a line like this in httpd.conf::

LoadModule rewrite_module modules/

That line will load mod_rewrite and then 'RewriteEngine on' should work as well (assuming of course the module itself is installed).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-03-14 00:15:44 -0500

Seen: 10,884 times

Last updated: Mar 15 '13