Invalid command ‘RewriteEngine’

Problem: After updating debian, my Apache2 started giving me


Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

Solution:
To enable Apache2 rewrite module you have to type


sudo a2enmod rewrite

…and then restart apache

/etc/init.d/apache2 restart

That is it for now. more posts later.

Advertisements

Q: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

A: I recently had this message showing after upgrading my apache server on my Debian and so I thought to share how I solved the problem with you guys.

anyhoo, go to apache2.conf file which is located in /etc/apache2 and then edit the file with your chosen editor and add the following line

ServerName 127.0.0.1

…finally restart apache

So here it is all put together

1./ Create a back up copy of your config file, your really do not have to do this however I do it cause I’m tiny bit paranoid about things going horribly wrong. So to do this open Applications > Accessories > Terminal. Type…

sudo cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf.bck

2./ Chose your editor, in this case VIM

sudo vi /etc/apache2/apache2.conf

If your are using VIM, move your cursor using the arrow keys to a blank line to insert a line and then press “i” (off-course without the double quotes).

After that, this line…

ServerName 127.0.0.1

…then save the file pressing [Esc][Shift]:wq

3./ Test and restart apache

sudo apache2ctl configtest

…and then

sudo apache2ctl restart