Tuesday, June 7, 2011

Installing LAMP on Ubuntu 11.04 Natty Narwhal

This is a short guide to setting up LAMP(Linux, Apache, MySQL, PHP) on Ubuntu 11.04 Natty Narwhal.
If you are using 10.10 you can check out my LAMP setup guide here.

First step is pretty easy, open a terminal and enter the following:

sudo apt-get install lamp-server^

During the installation process you will be asked to enter you MySQL root password, after that you have a basic lamp stack set up.

The following steps are optional but recommended:

Install CURL for php.

sudo apt-get install php5-curl

Install mod rewrite for url rewriting.

sudo a2enmod rewrite

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

This will open your sites config file, now find the XML block that looks like this:

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

change the AllowOverride directive from "None" to "All".  The result should look like this

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

now save and close the file.



Next restart Apache for the changes to take effect.

sudo /etc/init.d/apache2 restart

And that's it, happy coding!

1 comment:

  1. Works like a charm on my Jolicloud netbook, thank you very much

    ReplyDelete