LAMP stands for: Linux Apache MySQL PHP. It is a popular way to get a professional style web hosting setup on one’s own computer. It’s quite simple to install and provides the major components of what is necessary to design and implement as simple or as complicated a website as one can imagine, just like having your own web hosting right on your own computer to experiment with!
The steps involved to getting a fully operational LAMP setup in Linux Mint 13 Maya are outlined below, complete with clickable screenshots.
Once again my system is as follows:
Intel Core 2 Duo 2.67GHz box with 2 GB of DDR2 RAM, Nvidia 8400GS card, running Linux Mint 13 Maya Xfce 64-bit.
STEP 1 – open a terminal and type sudo apt-get install lamp-server^
(note the carat “^” after server)
STEP 2 – Configuring mysql server – It’s always a good idea to change the default password whenever possible, make up a good one and don’t forget it!
…back to installing…
STEP 3 – Done with the terminal install for now
STEP 4 – Test the APACHE installation, open a browser window and type in the address: http://localhost/
Now test the PHP installation, for this we require a test PHP file in /var/www/ called test.php We can use a text editor as root, or as so often is the case we can type a command in the terminal: echo “<?php phpinfo(); ?>” | sudo tee /var/www/test.php
Once you do that, a restart of the Apache web server is required. That can be done by issuing this command: sudo service apache2 restart
After that is done, go back to the web browser and enter this address: http://localhost/test.php/ and you should see a page like this one describing your PHP installation:
STEP 5 – Fixing the Apache server qualified domain name error you may have seen in the terminal is easy enough at this point as well. Enter the following command in the terminal:
echo “ServerName localhost” | sudo tee /etc/apache2/conf.d/fqdn
Then restart the Apache server: sudo service apache2 reload
STEP 6 – Configure MySQL
It’s important to bind MySQL to your localhost IP address. Typically that IP address is 127.0.0.1, but we can verify that by issuing the following command:
cat /etc/hosts | grep localhost
In my case I saw this:
Next, verify you have the correct BIND address:
cat /etc/mysql/my.cnf | grep bind-address
In my case I have the proper 127.0.0.1:
STEP 7 – Installing PHPMyAdmin
The most convenient way to administer MySQL is by using this handy tool. As we’ve discovered so far, the process involved is quite easy. Back to the terminal we go, this time type: sudo apt-get install libapache2-mod-auth-mysql phpmyadmin
It will go through the familiar downloading process, then a screen will pop up asking which webserver to choose to be automatically configured to run PHPMyAdmin – Please choose Apache2 by pressing the space bar:
The next screen to pop up asks if you would like to use dbconfig-common to facilitate the use of PHPMyAdmin – as the screen shows, you should choose “Yes” unless you are an expert administrator.
Next, enter the MySQL password you entered earlier
Now, enter a password for PHPMyAdmin to register to the database server, then confirm on the next screen
STEP 8 – Testing PHPMyAdmin
Let’s make sure it’s working, type this address in your browser:
You should see this:
Now let’s login with root and the password we created earlier:
Success! Congratulations, you have successfully installed Apache web server, MySQL, and PHP on your Linux Mint 13 machine. Hopefully the steps involved were straightforward and will reward you with years of fulfilling web development on your own computer.