Installing LAMP

Default featured post

LAMP stands for Linux, Apache, MySql, and PHP. Installing mentioned packages in Linux is not difficult task as some users think that it is complex and procedure involves in manipulating many text file which is haunting and exhaustive. In fact installing LAMP if is not simpler than Xampp or Wamp in Windows, it is not harder than them. With few commands you can establish your local host to test your own website. Of course, for hosting a website you need to do extra configuration which will not discuss here. For installing Apache, MySql, and PHP you either can install them separately or just install them with one command. Here both ways are discussed.

If you want to install all mentioned package with one command, just type the following commands in your Linux console.

$ sudo apt-get install tasksel
$ sudo tasksel install lamp-server

Now, go to your web browser and type localhost. If it shows It works! message then everything has done perfectly and works great. By contrast, if you face with the problem which mentions that server/page not found or something similar to it, the best idea is restart Apache to make it work. You can restart Apache with the following command.

$ sudo service apache2 restart

If you want to stop use stop and restart to restart respectively.

Now, if you are interested to install the packages separately then use the following commands.

$ sudo apt-get install apache2
$ sudo apt-get install mysql-client-core-5.5 mysql-server-core-5.5
$ sudo apt-get install apt-get install php5 libapache2-mod-php5

Note that the first way may do not work in some distribution. It is tested on Ubuntu and works great.

More information can be found in the official websites of the packages.