mod_rewrite, Apache2 and Ubuntu Gutsy

2007-11-18 by xpheas
The mod_rewrite module is not activated by default, if you need the module, do this:

1. Open a Konsole and type "sudo a2enmod" (the apache module-configuration tool)
BASH-Code:
1
2
3
Which module would you like to enable?
Your choices are: actions alias asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authnz_ldap authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta cgid cgi charset_lite dav_fs dav dav_lock dbd deflate dir disk_cache dump_io env expires ext_filter file_cache filter headers ident imagemap include info ldap log_forensic mem_cache mime mime_magic mod_python negotiation php5 proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy rewrite setenvif speling ssl status suexec unique_id userdir usertrack version vhost_alias
Module name?

2. Enter the module name "rewrite" and press enter
3. Open "/etc/apache2/sites-enabled/000-default" with sudo rights and change the "AllowOverride" option from "None" to "All" in the first 2 <Directory /> Blocks
BASH-Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<VirtualHost *>
        ServerAdmin root@xpheas.com
        DocumentRoot /var/www
 
				#first block
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
 
				#second block
        <Directory /var/www>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

4. Restart the webserver (sudo /etc/init.d/apache2 force-reload) and the module should work!

  « back

2008-05-20 by Ulysses
Thanks. It worked. I love simple instructions.


2008-10-01 by manish
Worked like a charm. Thanks


2008-10-22 by Joe | Website
Worked for me. Yeah baby!


2009-02-24 by Naijadev
Done everything here and the page is still not displaying well(applying the css)! Am running ubuntu intrepid.


2011-04-21 by vivek
"sudo a2enmod" this comand not working on my konsole. it is giveing an error comand not found


2012-09-19 by Rafael
Perfect!! Thanks from Brazil :D


Feel Free to Leave a Comment

Name:*


Email: (not visible)


Website:


Comment:*