Manually installing LAMP (Apache 2, MySQL, PHP 5) and phpMyAdmin on Ubuntu 10.10

Post to Twitter

In a previous article I showed you how to create a LAMP server using Tasksel. I’m more of a hands on developer so today I will show you how to create a LAMP server on Ubuntu manually. There are a lot of guides out there that discuss this topic however many are outdated so my hope is to provide something that is more up to date and accurate.


Note: My installation was done on a clean Ubuntu 10.10 system running under VMWare Workstation.

From the command line:

$ sudo apt-get update
$ sudo apt-get install apache2
$ sudo apt-get install php5 php5-dev libapache2-mod-php5 php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ps php5-pspell php5-recode php5-snmp php5-tidy php5-xmlrpc php5-xsl php5-common
$ sudo apt-get install mysql-server mysql-client php5-mysql

You will be prompted to create a password for MySQL.

Restart Apache:

$ sudo /etc/init.d/apache2 restart

Installing phpMyAdmin is easy:

$ sudo apt-get install phpmyadmin

You’ll be prompted by a dialog at some point, make sure to choose Apache 2. After that you need to answer a few more dialogs, the default is fine. Set the passwords accordingly and your done.

You can access phpMyAdmin now from this address: http://localhost/phpmyadmin/

To login to phpMyAdmin use root as the user and the password you entered previously.

By default I noticed that phpMyAdmin allows access from remote computers. This was not ideal to me, instead I wanted it locked down to localhost. You can do this by editing the following file:

$ cd /etc/phpmyadmin
$ sudo pico apache.conf

Add the following lines:

Don’t forget to restart Apache:

$ sudo /etc/init.d/apache2 restart

Post to Twitter

This entry was posted in Open Source, PHP, Ubuntu. Bookmark the permalink.

4 Responses to Manually installing LAMP (Apache 2, MySQL, PHP 5) and phpMyAdmin on Ubuntu 10.10

  1. Hi, Thanks For The Post. Gr8 Work. :)

  2. Rakhunathan says:

    Hey please can somebody help me to install php and ruby-on rails on a same machine…apache ‘s port get conflicts..:-(

  3. Pingback: Setting up an Ubuntu PHP development environement | Giant Flying Saucer

Comments are closed.