LAMP is short for Linux, Apache, MySQL, PHP. This article shows students and new users how to install Apache2, MySQL and PHP. You will need sudo or root access for the commands in this article.
First, need to login to Ubuntu Server via SSH
AND Update
#sudo apt-get update
after installing apache on the server
#sudo apt-get install apache2
then Install MySQL
#sudo apt-get install mysql-server php5-mysql
#sudo mysql_install_db
#mysql_secure_installation
then Install PHP
#sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
Restart Server
#sudo /etc/init.d/apache2 restart
Check Apache
for testing apache service you can run the command
#php -r ‘echo “\n\nYour PHP installation is working fine.\n\n\n”;’
then browse the IP on the web browser, you will get message “Your PHP installation is working fine”
Congratulations, you have just Installed a Ubuntu LAMP Server!