Installing the LAMP Stack on Ubuntu 11.04 – Natty Narwhal

How to install the LAMP stack

Once you’ve installed Ubuntu, you’ll need Apache MySQL, and PHP to complete the stack. We’ll install phpmyadmin while we’re at it.

For this example I installed LAMP using Ubuntu 11.04 (Natty Narwhal), but this example  should work on many previous releases; I can’t say how far back.

  1. Open your terminal.
  2. Run sudo apt-get install apache2 mysql-server php5 phpmyadmin .
  3. Set passwords when prompted.
  4. Run sudo service apache2 restart.
  5. Go to http://localhost/ in your favorite browser. When you see Apache’s “It works” page, Apache is installed. If you get the following error:
    ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

    simply edit the httpd.conf file by

    1. running: sudo gedit /etc/apache2/httpd.conf
    2. Add the following line to the file (which will be blank be default):
      ServerName localhost
  6. Go to http://localhost/phpmyadmin. If you don’t see phpMyAdmin’s welcome page, create a symlink by running: sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf and then reload Apache: sudo service apache2 reload . You should now see phpMyAdmin’s Welcome page.
  7. Have a sandwich.

Once LAMP is installed and running, you’ll probably want to configure Apache virtual hosting so you can begin using your new development server.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s