How to install LAMP on Ubuntu
Install Apache :
open up the terminal and run following commands.
sudo apt-get update
sudo apt-get install apache2
this should install apache on your machine.
what does “sudo apt-get update” does??
what does “sudo apt-get update” does??medium.com
Install MySQL :
run the following command on the terminal.
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
while running this you would be asked to set a root password.
after installing MySQL it has to be activated.run the following command to do so.
then run the following MySQL set up script
when running above script you will be asked several questions.If you want you can change root password here.for other questions better to go with the default options.
Now only one step is remaining.it is to install PHP.
Install PHP :
Open the terminal and type the following command.
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
if will be usefull if you add php to the directory index.run the following command to do so.
sudo nano /etc/apache2/mods-enabled/dir.conf
add index.php to the begining of index files listed in the above file.
There are so many PHP modules that are very useful in your future developments.For the moment those are not required.Those can be installed in this way.
PHP has very large number of modules and libraries that we can used in our servers.We can install them in our local…medium.com
Now you are all set to go.restart the apache server so that the changes will take effect.run following command to restart apache server.
sudo service apache2 restart