LAMP Stands for Linux,Apache,MySQL and PHP. Most of the websites works with the above combination. if you think the above combination will be only on servers where the hosting are made, that is wrong you can made on your own PC which has Linux. The installtion of LAMP on Linux Mint is simple quiet when compared to other Linux environment.
In other Linux environment we need to install all the above separately by separate commands. But in Linux Mint you can install the above in one command. Here i am listing the steps to install LAMP in one command.
This post is not about Installation Linux Mint. Only about the installation of AMP(Apache,MySQL,PHP).
Copy and Paste the line in the Terminal.
geeksite@geeksite-PC ~/Desktop$ sudo apt-get install lamp-server^ (sudo)Password for geeksite:
Once entered the command, it will ask you to enter the password for the user. it will search the required package for LAMP server, in the end it will prompt you to confirm the downloading and installation of packages. Type Y and then press enter.
After the installation of the all packages it will prompt you to configure the MySQL root password. Type new root password for MySQL in the Next Screen.
Repeat the root password.
After that it will continue to install the other packages that are required by the AMP.
To make sure everything installed correctly we will now test Apache to ensure it is working properly.
The default location of the documentroot is /var/www/, you can place your web pages for your website.
1. Before testing Apache, restart the Apache server.
geeksite@geeksite-PC ~/Desktop$ sudo /etc/init.d/apache2 restart
2. Open up any web browser and then enter the following into the web address:
http://localhost/ or http://127.0.0.1
You will get the web page saying “It Works!”. Now the Apache is working fine. Apache’s default document root is /var/www/ on Linux Mint, and the configuration file is /etc/apache2/httpd.conf. Additional configurations are stored in the /etc/apache2/conf.d/ directory.
For testing the PHP, Place one PHP file on to the default directory of the Apache.
Step 1. In the terminal copy/paste the following line:
geeksite@geeksite-PC ~/Desktop$ sudo vi /var/www/phpinfo.php
This will open up a file called phpinfo.php.
Step 2. Copy/Paste this line into the phpinfo file:
Step 3. Save and close the file. use Esc + ;wq for saving the file.
Step 4. Now open you’re web browser and type the following into the web address:
http://localhost/phpinfo.php or http://127.0.0.1/phpinfo.php
The page will look like below:
This is optional, MySQL will normally listen on the localhost only. if you want to listen MySQL on the other IP you need to edit the /etc/mysql/my.cnf file.
geeksite@geeksite-PC ~/Desktop$ sudo vi /etc/mysql/my.cnf
Change the following line and put your ip on the place of 127.0.0.1.
bind-address = 127.0.0.1 -------> bind-address = 192.168.0.10
Next is to install phpMyAdmin, this graphical utility will help you to manage databases very easily.
geeksite@geeksite-PC ~/Desktop$ sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
Installation will prompt you to select the web server for automatic configuration. Use space to select the web server type and then press Enter.
Next screen will prompt you for configuring database called db-common for phpMyAdmin. Use the tab key to select yes and Press Enter.
Next it will prompt you to enter the password for MySQL root user, please enter the MySQL root password that created earlier.
It will prompt you to type the password for MySQL application password for phpmyadmin.if you left it blank, a random password will be generated. Type the password of your wish and press Enter.
Confirm your password in the next screen.
If would like to manage the MySQL through phpMyAdmin, Open the Mozilla Firefox and Type the following web address.
http://localhost/phpmyadmin or http://127.0.0.1/phpmyadmin
You will get MySQL login page, Please type the username and password set by you during MySQL installation.
After the Login you will get the Main Page of the phpMyAdmin. Here you can manage the database very easily.
That’s all!. Now the Linux Mint 12 is ready with AMP. You can put your web pages in the /var/www directory for single site.