Wednesday, 18 July 2012

Installing lamp

Installing lamp in ubuntu is pretty simple.

$> sudo apt-get install tasksel

where tasksel provides a user friendly interface allowing easier installation of lamp.
Run tasksel as a super user

$>sudo tasksel

A gui interface opens up,use the up/down arrow key to select the lamp server.press space to set it for installation and continue.

during installation provide the mysql password.

Once installation is complete,how to check lamp is working ?

Go to /home/var/www this is the directory from which you have to work as it is the default directory of lamp.Make a text document for a simple php script.

<?php
phpinfo();
?>

save it as index.php

Go to your browser and type localhost/index.php.


This then prints all the information of your server,in your browser ... Its a hello world program in php !!

If it does not do so your apache server may not be running.

To start it.
$ sudo /etc/init.d/apache2 start
To restart
$ sudo /etc/init.d/apache2 restart
To stop
$ sudo /etc/init.d/apache2 stop

You can also install phpmyadmin which provides a swanky gui to manage databases,

$>sudo apt-get install phpmyadmin

to access localhost/phpmyadmin needs to be entered in the browser,the user being "root" and password is what you have set.