Setting up a LAMP Server

This post is to help the people who is willing to try out web technologies using LAMP. I think it will be more helpful to do a brief on ‘what is LAMP?’

LAMP represents the open source web platform. Its a portion of 4 resources
L – Linux (any distribution of gnu/linux).
A – Apache ( web server).
M – MySQL (relational database management system).
P – either Perl,Python or PHP (OO scripting language).
In this tutorial I’m using Linux Mint 7 Gloria, Apache2, MySQL and PHP5.

Step 01 → update your system’s package repository. So you can get the latest versions of available resources.

apt-get update

Step 02 → download and install Apache web server

apt-get install apache2

To check what the web server is running without any problems type ‘http://localhost‘ on your browser. If no problems, then it will give a test output as follows,

Step 03 → get PHP and its dependencies.

apt-get install php5 libapache2-mod-php5

after installing php you have to restart apache web server as follows,

/etc/init.d/apache2 restart

Step 04 → Now you need to make sure that PHP and Apache is working fine together. To do that use the following test php scrip and save it as phpinfo.php in server root(/var/www/).



Then call the script through the web browser. The URL should be like this, http://localhost/phpinfo.php . Then it should show all PHP configuration settings in a coloured table.

Step 05 →  get MySQL

apt-get install mysql-server

During the installation you will get a package configuration screen. Set root password for MySQl carefully. If you didn’t get that screen set password for MySQl manually,

mysql -u root
mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘user_pass_word’);

Step 06 → PhpMyAdmin installation

PhpMyAdmin is a web based free graphical database management and MySQL administration tool. This tool  makes all the MySQL database operations easy. Such as creating tables, creating databases inserting values, deleting values and lot more.

apt-get install phpmyadmin

during its installation it will ask what server to use. Apache or apache2 ? Select apache2 . Then it will prompt you to set a password for phpmyadmin. Done! To use Phpmyadmin type http://localhost/phpmyadmin on your browser.



Congrats! Your LAMP system is ready to do extraordinary things for you. 😀

Note: all the command line actions above are held as ‘root’.


9 Responses to “Setting up a LAMP Server”

  1. John Says:

    Very useful !
    Thanks !

  2. John Mica Says:

    I really like this blog. Please continue the great work. Regards!!!

  3. Orchids Says:

    All Sri Lankan Bloggers invited to join the
    one and only Multi lingual

  4. Uggs Says:

    very good put up, i definitely love this web site, carry on it

  5. Dushi Says:

    Thanx a lot ..

  6. Max Colon Says:

    It really is a nice and helpful piece of info. Iˇm happy that you can shared this helpful information with us. Please keep us informed like that. Thanks for discussing.

  7. Mahesh Arandara Says:

    Very useful tutorial. Thanx a million bro.

  8. Semika Says:

    Resume posting, 🙂

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

%d bloggers like this: