LAMP is a open sources packet software that use for building a powerfull web server. lamp is consist of LINUX operating system, apache web server, mysql for saving data of web server, and php for processing dynamic content. now this article will help you to install lamp and cofigure it step by step.
1. Install Software
sudo apt-get update
sudo apt-get install apache2 mysql-server php libapache2-mod-php
php-mcrypt php-mysql
2. configure MySQL
sudo mysql_secure_installation
and follow the step below
first you will be asked for password of MySQL for root account and configure setup "VALIDATE PASSWORD plugin".
Enter password for user root:
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No:
next, you have to choose level password validation . as you can see from the information on your screen. There are 3 level password validation. Choose 2 for the strongest, 1 for the medium and 3 for the lowest
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and
dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0
Okay. Type Y for the rest questions. It will removed anonymous user, remove test database, disable remote login, and load these configuration.
3. Configure APACHE
Now we configure web apache server. Type this command below to open file “dir.conf”
sudo nano /etc/apache2/mods-enabled/dir.conf
Add index.php to the beginning of index files. The page should now look like this:
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.php
index.xhtml index.htm
</IfModule>
4. Test PHP.
Enter the following command to create php file named info.php
sudo nano /var/www/info.php
add the following script :
Save and exit, next, restart your apache server
sudo service apache2 restart
then access your info.php In your bowser with visiting the URLhttp://your_ip_address/info.php. if your info.php appear then you have succeed to install your LAMP