In today’s tutorial I will show installing lamp in ubuntu, lamp stands for Linux, Apache, MySQL, and PHP.
Apache is your actual webserver. It can handle serving files, directory indexing, serving HTML files, etc.
apt-get install apache2
PHP is what most web scripts run on and is part of a lamp server. To install php properly you need to install the php5 package and then the php5 apache module. Then you need to restart but if you want to add mail to this I suggest simply restarting after the next step.
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
Send/Recieve Emails (sendmail)
If you want to send or recieve emails its easiest just to install the sendmail package and restart Apache, this step is optional. After you restart your web scripts should be able to send emails.
sudo apt-get install sendmail
Install MySQL and MySQL PHP/Apache Module
MySQL is what most servers and sites use for their databases, web hosts should definitely install this. You can install MySQL and its PHP module by running the following command.
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
After you have installed lamp in ubuntu you need to restart Apache to make sure everything is loaded correctly. You can do so by running the following command.
sudo /etc/init.d/apache2 restart
Also if you want to make life easier when working with MySQL you can also install php.
sudo apt-get install php
This should install all the software needed for your basic server. Your /var/www/“.files should be located in “
You can access your php from
I hope this tutorial helped with installing LAMP in Ubuntu. More tutorials are on the way so stick around and don’t forget to bookmark!