LAMP is an acronym for Linux, Apache, MySQL and PHP, a set of open source software that is installed on the virtual server so that we can install and run other open source software using the php language. Like WordPress, Joomla …
In this tutorial we will only learn how to install Apache, MySQL and PHP with just one command. I will do a tutorial on Ubuntu server 12.04, user root. Ubuntu is a Linux-based operating system, so I skipped the Linux installation.
1. Install LAMP
To install LAMP, you can install one service at a time, however, I will guide you through a quick installation:
# apt-get update
# apt-get install lamp-server^
During the installation, you will need to enter the root user password for MySQL, enter and save this password.
2. Check the operation and connection between Apache and PHP
From the terminal window, create the file:
#vim /var/www/info.php
Copy the following code:
phpinfo();
Moves the owner of the directory containing the web to apache’s user:
# chown www-data: www-data -R/var/www/
Restart apache:
# service apache2 restart
Use wget to check:
# wget http://example.com/info.php
Or from the browser, visit http:// example.com/phpinfo.php
Then you have completed the installation of LAMP on Ubuntu.