How to install LAMP server in Ubuntu 12.04 or older version using a few command lines.
LAMP is an open source Web development platform which is widely used on VPS and other server setups. LAMP (Linux, Apache, MySQL and PHP) uses Linux as operating system, Apache as the web service and MySQL as the database management system and PHP as the server-side scripting language which is widely used in web development. UbuntuLife.net is also hosted on LAMP server environment with additional scripts for speed and security.
Originally these four programs were not designed to work specifically with each other, but these tools were developed in close conjunction. LAMP has become popular because it is free, open-source, and easily customizable and because it integrates well with most current Linux distributions including Ubuntu 12.04.
While I was studying in the university we had to set up LAMP server software by software to understand how it works but I will show you the fastest way how to install LAMP server on Ubuntu 12.04.
This tutorial is tested on Ubuntu 10.04, 10.10, 11.04, 11.10, 12.04 and 12.10 and probably other Ubuntu versions as well but I would recommend using Ubuntu 10.04 or later version to install LAMP server.
Open terminal and type the fallowing command:
One this installation is complete type the following command:
And navigate with keyboard arrow keys and select “LAMP server” from the list using “space bar” and then hit “Enter”. See below
During the installation you will be asked to create a new MySQL root password. For security reasons, don’t use your Ubuntu password.
Now you have Apache, MySQL and PHP installed on your Ubuntu 12.04 to make sure if Apache is working correctly open your web browser and type “localhost” in the address bar and hit enter. You will see a following message:
I already modified index.html to show different method. index.html is located in /var/www/ folder of your system.
Testing LAMP installation
To make sure if PHP works you can create a create a tiny PHP file as described bellow:
Open terminal and type in the fallowing command:
and write the fallowing code and hit save and exit:
Restart Apache server to apply the changes by using the fallowing command:
Now open web browser and type:
And if PHP is installed properly you will see the page that looks like this
Now you have LAMP server installed on Ubuntu 12.04 but for better database management I would recommend to install phpMyAdmin. It will allow to configure you MySQL databases via simple graphical interface.
How to install phpMyAdmin in Ubuntu 12.04
Open the terminal if it’s not open already and type the following command:
You will be prompted with a screen like you can see bellow asking to select web server to configure to run phpMyAdmin. Choose “apache2” by pressing “space bar” and then hit Enter.
When the process is completed you can now open your web browser and type “localhost/phpmyadmin” in the address bar. You should see phpMyAdmin login screen. Use username “root” and password you chose during phpMyAdmin installation.
Now you have fully functional LAMP server + phpMyAdmin for better and easier management of MySQL database.
Let me know if you have any problems during installation and I will try to help.