I use my home computer running SuSE 9.0 to experiment with the current Drupal CVS version under Apache2. Here is what I did to enable clean URLs:

NOTE: All paths given are only for SuSE 9.0.

The first problem was to get mod_rewrite running under Apache2:

I spent about 12 hours trying to enable mod_rewrite for apache2, without any luck. I searched the web, the Apache forum and Drupal's site and tried every trick I found -- nothing worked. Finally I remembered there was something in Yast (SuSE's control center, so to speak) about HTTP servers and went there. It had a listing for a mod_rewrite (under Yast > Network Services > HTTP Server) that was disabled, so I tried enabling it -- and finally mod_rewrite was shown as a running module in phpinfo()..... BTW it does no good to play with Drupal's Clean URL settings until you can see that mod_rewrite is enabled in phpinfo()

Next problem was to get all the Apache2 configuration files configured properly. Here are the changes I made to the config files:

Note: Be sure and change "/srv/www/htdocs/drupal-cvs/" to whatever the full path to your drupal directory is and "drupal-cvs" to the name of your drupal directory!

In -- /srv/www/htdocs/drupal-cvs/.htaccess

I changed  <IfModule mod_php4.c>

       to <IfModule sapi_apache2.c>
.

I also un-commented  # RewriteBase / 

and changed it to      RewriteBase /drupal-cvs



Next, I created the file /srv/www/htdocs/drupal-cvs/httpd.conf.local with this information in it:

<Directory "/srv/www/htdocs/drupal-cvs/">
  AllowOverride All
</Directory>



In -- /etc/sysconfig/apache2

I changed APACHE_CONF_INCLUDE_FILES=""  
.
to APACHE_CONF_INCLUDE_FILES="/srv/www/htdocs/drupal-cvs/httpd.conf.local"
.
so that it would include the file httpd.conf.local when apache2 started.


After all this is done, restart apache2 (or reboot the computer if you don't know how to do that), start Drupal, login as user 1 (the one with administrator powers) and go to administer >> settings and change Clean URLs: to Enabled and then save the configuration (button at the bottom). Hopefully it works but sometimes it doesn't. If it doesn't, and you get a permission denied page -- don't panic, just use the BACK browser button to back up to the settings page and change Clean URLs back to Disabled and save the configuration again.

Have fun.
;-)

Comments

cel4145’s picture

I had some trouble getting SUSE 9.2 professional to work. After making the obvious changes to .htaccess regarding sapi_apache2.c, AllowOverride for /srv/www/htdocs, and rewrite base, all of the document root installations (there are two) worked fine. However, user account public_html directories did not. I ended up changing the following directory definition in /etc/apach2/mod_userdir.conf

<Directory /home/*/public_html>

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

                <Limit GET POST OPTIONS PROPFIND>
                        Order allow,deny
                        Allow from all
                </Limit>

                <LimitExcept GET POST OPTIONS PROPFIND>
                        Order deny,allow
                        Deny from all
                </LimitExcept>

        </Directory>

Everything worked fine after that.