Cakephp + Ubuntu 8.04 + Apache2 Mod_rewrite

This tutorial assumes that you installed the basic LAMP stack that ubuntu comes with. It is also assumed that this is a development installation of CakePHP

1) Download CakePHP. My directory after I uncompress it is called ‘cake_1.2.1.8004′

*optional
2) Rename ‘cake_1.2.1.8004′ to ‘cake’

3) Move the ‘cake’ directory into ‘/var/www/’ so your full path becomes ‘/var/www/cake/’

4) Enable mod_rewrite

username@ubuntu:/$ sudo a2enmod rewrite
Enabling module rewrite.
Run '/etc/init.d/apache2 restart' to activate new configuration!

5) Enable appropriate rules in ‘/etc/apache2/sites-available/default’

username@ubuntu:/$ sudo vi /etc/apache2/sites-available/default

5a) Change the following

Directory /
Options FollowSymLinks
AllowOverride None
/Directory

To


Directory /
Options FollowSymLinks
AllowOverride All
Directory

5b) Change the following

Directory /var/www/
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
Directory

To


Directory /var/www/
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
/Directory

6) Restart apache2

username@ubuntu:/$ sudo /etc/init.d/apache2 restart

default screenshot