A LAMP server is a combination of software that is suitable for building dynamic web sites and web applications for a local network or for the world-wide web, with many variations to the LAMP Stack the most common one is made up of Linux, Apache2, MySQL and PHP, giving you a powerful platform to develop all sorts of applications for most any purpose, ever play a text-based game on-line, how about an on-line database driven application, perhaps you need to keep track of staff or even customers orders. Regardless of what you are wanting to achieve with your LAMP server you should know that the power of these tools will enable you to be as creative as you like when developing your website.
1.) Update System.
First you should make sure that your system is up to date, to become Super User, Open a Terminal and use the command below followed by your root password.
Now run the update and upgrade like so.
# aptitude update && aptitude upgrade
2.) Install MySQL.
Install and setup MySQL, you will be asked to set a root password.
# aptitude install mysql-server mysql-client
3.) Install Apache2 Web Server.
The Apache web server can be installed with the following command.
# aptitude install apache2 apache2-doc
4.) Configure User Directories.
This will allow the user read and write permissions to Apache2’s root web directory.
# a2enmod userdir
Configure Apache module userdir in /etc/apache2/mods-enabled/userdir.conf like so.
<IfModule mod_userdir.c> UserDir public_html UserDir disabled root <Directory /home/*/public_html> AllowOverride All Options MultiViews Indexes SymLinksIfOwnerMatch <Limit GET POST OPTIONS> Require all granted </Limit> <LimitExcept GET POST OPTIONS> Require all denied </LimitExcept> </Directory> </IfModule>
5.) Create Web Directory.
You must create this directory as the user not as root so first you need to exit Super User.
Now create the new Web Directory.
$ mkdir /home/$USER/public_html
6.) Change Group of Web Directory.
Become Super User again, then change the web directory to allow apache2 access.
# chgrp www-data /home/<username>/public_html