Thursday, March 26, 2009

Finally... Clean URLs in Drupal with Debian Lenny

I managed to find out how to enable clean URLs in Drupal (I did a manual installation of Drupal 6.10) on Debian 5.0 (Lenny). What bliss. The correct advice was found among the comments to the "clean URLs with Debian" page that I referred to before. In order to save some potential readers the trouble, and as a reminder to myself, here is the recipe (everything must be run with root privileges):

  1. Execute a2enmod rewrite to enable mod_rewrite. You can run apache2ctl -M to verify that the module is loaded (shows up as rewrite_module in the list) after performing step 3 below.
  2. Change the file /etc/apache2/sites-available/default so that the section Directory /var/www/ includes the statement AllowOverride All instead of AllowOverride None.
  3. Reload apache modules by issuing /etc/init.d/apache2 force-reload.
After this you can enable clean URLs through the administration menu in Drupal.

2 comments:

  1. Anonymous3:15 PM

    Not true.

    My file /etc/apache2/sites-available/default looks like this:


    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/

    Options FollowSymLinks
    AllowOverride All


    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all


    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all


    I force-reloaded my Drupal 6 site. The Enabled button for Clean URLs remained greyed out.

    Maybe some more suggestions?

    ReplyDelete
  2. Thanks a lot for this post !!

    Was enough to do until step 4 for me.

    Thanks :) drupal

    ReplyDelete