Wednesday, October 17, 2012

Install LAMP in Ubuntu 12.10 Quantal(Apache, MySQL, PHP)

This is a short guide to installing a basic LAMP(Linux, Apache, MySQL, PHP) development environment on Ubuntu 12.10 Quantal Pangolin.

First install lamp:
Open a terminal and run the following:

sudo apt-get install lamp-server^

After the lamp server installation you will need write permissions to the /var/www directory.  Follow these steps to configure permissions.

Add your user to the www-data group

sudo usermod -a -G www-data <your user name>

now add the /var/www folder to the www-data group

sudo chgrp -R www-data /var/www

now give write permissions to the www-data group

sudo chmod -R g+w /var/www

now log out and log back in to see the changes reflected in nautilus.

Some extra things to install
The following are not essential but they are things I almost always need as part of a LAMP install so I have included instructions on installing them.

Curl:

sudo apt-get install php5-curl

Mod rewrite:

sudo a2enmod rewrite

To enable mod rewrite you also need to do some apache configuration:

sudo gedit /etc/apache2/sites-available/default

and change AllowOverride from None to All:

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

sudo /etc/init.d/apache2 restart

GD2 Graphics Lib:

sudo apt-get install php5-gd

And that's it, how easy was that?  Ubuntu rocks!