San Sign Info

January 26, 2009

How to enable htaccess on ubuntu server

Filed under: Linux, SanSignInfo — Tags: , , , , , , — San @ 1:40 pm

Here are the simple steps to enable htaccess on ubuntu server

locate the folder /etc/apache2/sites-available and edited the file default

I have highlighted the required changes in Bold letters.

NameVirtualHost *
<VirtualHost *>
ServerAdmin admin@site.com

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# This directive allows us to have apache2’s default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/
</Directory>

Default for AllowOverride is none, should be all
/etc/init.d/apache2 restart

Now run the following command on terminal
code:
sudo a2enmod rewrite

You can verify what modules are loaded with:
code:
sudo apache2ctl -l

For any further help please add reply on to the same post.

Thank you,

San :)

Powered by WordPress