Thursday, 24 February 2011

cakephp looking "funny" on Ubuntu?

I just installed cakephp on Ubuntu 10.10 but it looked like the CSS styles weren't there, making it look odd.

Its because of the "AllowOverride all" option but took me an afternoon trying to figure out what file to change. All websites point to httpd.conf but the structure is very different for Apache2.

Thankfully someone had posted a message for Ubuntu back in 2008.

Heres what to do (assuming you have already installed apache)

Open a terminal window (Applications -> Accessories ->  Terminal)

Enter sudo a2enmod rewrite to switch on mod_rewrite if it isn't already.

Enter gksudo gedit /etc/apache2/sites-enabled/000-default to open the default set up for apache.

Look for <Directory /var/www/> assuming /var/www is the default web root.

And change AllowOverride None to AllowOverride All.

Save and close the file, return to the terminal window and enter sudo apachectl restart to restart apache.

Go back to your cake site, assuming its http://localhost/cake1_3 and it should now look pretty :)

No comments:

Post a comment