LAMP installation on Ubuntu 9.04

Last night, i was thinking of configuring LAMP on my UbuntuBox. LAMP is an open source Web development platform that uses Linux as the operating system, Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language. (Sometimes Perl or Python is used instead of PHP.) Because the platform has four layers, LAMP is sometimes referred to as a LAMP stack. Stacks can be built on different operating systems. Developers that use these tools with a Windows operating system instead of Linux are said to be using WAMP; with a Macintosh system, MAMP; and with a Solaris system, SAMP.

I tried the following and got success:

Open terminal and typed:

neeraj@nee-pc:~$ sudo apt-get install lamp-server^

The total size downloaded was 43 mb approx and took about 20 minutes.
let us see, whether the installation succeeded??
open Firefox and type http://localhost/ . If the browser displays "It Works", means the installation is successful.

PHP test:

type in the terminal the following

neeraj@nee-pc:~$ sudo gedit /var/www/testphp.php

and type in the following code:


Save and close the file and restart Apache by:

neeraj@nee-pc:~$ sudo /etc/init.d/apache2 restart

Open the browser and put http://localhost/testphp.php in the addressbar, hit enter and if you see the following, php has been successfully installed.

php info
php info

Next is the turn of MySQL:

MySQL has to be bound with the localhost so type in the following to check whether the bind-address is

neeraj@nee-pc:~$ gksudo gedit /etc/mysql/my.cnf

I also installed phpMyAdmin which is optional:

open terminal and type

neeraj@nee-pc:~$ sudo apt-get install libapache2-mod-auth-mysql phpmyadmin

After this type in:

neeraj@nee-pc:~$ sudo ln -s /usr/share/phpmyadmin/ /var/www/phpmyadmin

type in http://localhost/phpMyAdmin in the addressbar of your browser and you get the following homepage:


Log in with the MySQL accoun and you are done. I forgot the password and hence tried the following:

sudo dpkg-reconfigure mysql-server-5.0

to reset the MySQL Password.

Now, everything’s peachy. 🙂

neeraj@nee-pc:~$ gksudo gedit /etc/mysql/my.cnf

6 comments on “LAMP installation on Ubuntu 9.04

  1. Pingback: Lawn Mowers » Blog Archive » Lamp Installation on Ubuntu 9.04 « Nee’s Weblog..!

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s