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’.

..::CSS Positioning::..

An Important Tip about CSS positioning

This is a very simple part of CSS positioning. But these simple methods would help you to arrange your web items as you wanted on your web page. Most of the time when browsing the web we can find web pages with overlapped images, buttons and even text. All of them are neatly don by using CSS. My example will explain you how to overlap two ‘div’ elements using absolute positioning. The following coding should appear inside of the ‘ ‘ tags in your HTML page.


Notice my ‘position’ property. It is set to ‘absolute’. You can also set it as ‘relative’. But your result would be different from mine. By setting the ‘top’ property to 30px, I brought the starting point of div-A, 30px from top corner of the browser. Then I positioned the starting point of div-A, 40px right from the right corner of the browser by setting the ‘left’ property into 40px. Like this you can push your div elements where ever you want, by using this absolute positioning method.
Now I’m going to create another div called ‘div-B’ and position it on top of ‘div-A’.

<div style=”background-color:red;
position: absolute;


To add more action on your page make your div elements transparent by using the property named ‘opacity’. And set its value between 1.0 – 0.0. (This format of assigning values for opacity might not work in IE (internet explorer). but guarantee for Firefox.). Now they act as ‘layers’.
Like this if you want to position your images and buttons, just simply put them in to a ‘div’ and place them where ever you want. Your free to do experiments with this cods and make your web pages looks perfect. Cool huh!



%d bloggers like this: