Enabling Mod rewrite?

Hi all,

I'm trying to enable Mod Rewrite on Ubuntu for my Wordpress install to allow permalinks.

I tried to run:

a2enmod rewrite

But it errored with "/Could not create /etc/apache2/mods-enabled/rewrite.load: No such file or directory". There was no "mods-enabled" directory there, so I created it. Re-ran 'a2endmod rewrite' and it ran successfully.

However, when I restarted Apache, I get:

Syntax error on line 160 of /etc/apache2/apache2.conf:

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

Action 'configtest' failed.

The Apache error log may have more information.

…fail!

Line 160 of apache2.conf is the section preventing web browsers viewing .htaccess files…and looks correct based on other installs.

I'm guessing this is because I manually created mods-enabled, and the fact that its empty? Can anyone offer any suggestions?

Thanks :)

3 Replies

Hrm, /etc/apache2/mods-enabled should have been created by the apache2.2-common package, and there should be a bunch of things already in there…

What does "dpkg --list | grep apache" look like?

As below - formatted a little strangely, tried to tidy it up….

ii apache2 2.2.16-1ubuntu3.1 Apache HTTP Server metapackage

ii apache2-mpm-prefork 2.2.16-1ubuntu3.1 Apache HTTPServer - traditional non-threaded model

ii apache2-utils 2.2.16-1ubuntu3.1 utility Programs for webservers

ii apache2.2-bin 2.2.16-1ubuntu3.1 Apache HTTP Server common binary files

ii apache2.2-common 2.2.16-1ubuntu3.1 Apache HTTP Server common files

ii libapache2-mod-php5 5.3.3-1ubuntu9.5 server-side, HTML-embedded scripting language (Apache 2 module)

You were right, there should have been a bunch of things in there. No idea what caused the links to be deleted, but seems I had a similar problem to this guy:

http://thefunkcorner.blogspot.com/2008/ … dules.html">http://thefunkcorner.blogspot.com/2008/11/repairing-apache-22-modules.html

Restored them all (plus the php5 module!) and it all seems fine again….strange!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct