Quick installation of LAMP for Kohana on Ubuntu

Published:

Needed to get a LAMP environment up and running for some Kohana development. Starting with a more or less fresh install of Ubuntu, here's what I did.

Install LAMP

$ sudo apt-get update
$ sudo apt-get install lamp-server^

Install PHP modules used by Kohana

$ sudo apt-get install php5-curl php5-gd php5-mcrypt

Enable rewrite module

$ sudo a2enmod rewrite

Allow for .htaccess overrides

$ sudo vim /etc/apache2/sites-available/default

Find the part about the /var/www directory and set AllowOverride from None to All. Then save the file.

Remove annoying Apache warning

If you restart Apache now, you'll get a warning like this:

apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

To prevent that, add a line with "ServerName localhost" to the httpd.conf file.

$ sudo vim /etc/apache2/httpd.conf

Restart Apache

$ sudo /etc/init.d/apache2 restart