Deadpan Sincerity

April 27, 2008

Configuring Apache for clean URLs on Ubuntu

Filed under: The Internet — Tags: , , , — David Miller @ 5:43 pm

Have just finished making the relevant changes to Apache so that Drupal can generate clean URLs. Didn’t find anything anywhere that contained everything needed and worked for me, so here is what did work:

Check to see if the rewrite_module is enabled:

apache2ctl -M

Which generates a list of the modules. If rewrite isn’t there, enable it:

sudo a2enmod rewrite

I then changed the permission for rewrite in the apache sites-available file. Which was located at /etc/www/apache2/sites-available/default

In that file, I inserted the following:

<Directory /var/www/drupal>

AllowOverride All

</directory>

Where /var/www/drupal is the location of the folder containing my drupal installation, and within which all drupal sites will be stored.

Then restart apache

sudo /etc/init.d/apache2 restart

I then logged in to the drupal site as the administrator and navigated to Administer => Site Configuration => Clean URLs and enabled the option.

After which the url rewriting worked.

This worked for my setup which was Ubuntu 7.10, Apache 2.2.4, PHP 5.2.3-1ubuntu6 Drupal 6.2

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.