This tutorial will walk you through the installation of LAMP server on Linux Ubuntu 12.04 Precise Pangolin with the following easy steps.
Install the LAMP server.
The Ubuntu developers made easy to install and configure the LAMP server with a single terminal command. Open the terminal by pressing Ctrl+Alt+T or Navigate through Applications -> Accessories -> Terminal
sudo apt-get install lamp-server^
Don’t leave out the caret (^) at the end and to exit the Terminal after your use by typing exit command.
The apt package manager will now show the packages to be installed and ask for confirmation. Type Y and press Enter to confirm and continue with the install.
After downloading the packages, you have to set a password for the MySQL database root user.
Don’t leave it blank. So enter the ‘password’ for the MySQL database root user. And also confirm your password.
After confirming your password, apt will continue to installing the remaining packages. Now your LAMP server installation is complete. Next, do few more steps to configure LAMP server to work with your system.
Configure the LAMP server.
Open your favorite web browser window and enter the address http://localhost/. You should see a web page “It Works!”
We just confirmed that the Apache web server works, so next is to make sure that PHP installation is working,
Open a terminal. In Gnome navigate through Applications>Accessories>Terminal OR use “Ctrl+Alt+T” short cut.
sudo nautilus then hit enter, and enter your ‘password’ too,
a new window opens, Go to File System -> var -> www . Cretae a new text document file named info.txt.
open the file and enter the following codes,
<?php phpinfo(); ?>
and rename the file into info.php . Close the window and also type ‘exit’ enter on terminal. Open your favorite web browser window and enter the address http://localhost/info.php, and you can see a page displaying all the information about your PHP installation.
OR Use your favorite IDE (Netbeans or Eclipse) and create the phpinfo.php file on root of var/www directory with above code and open the same page on browser http://localhost/info.php.
Installing the phpMyAdmin.
phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the World Wide Web. phpMyAdmin supports a wide range of operations with MySQL. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement.
Open terminal and type
sudo apt-get install phpmyadmin enter.
Next step is to configure a web server with phpMyAdmin. Use the arrow keys on your keyboard to highlight apache2 and then use the space bar to select it enter to continue.
Next is to configure database called dbconfig-common with phpMyAdmin. Select Yes and press the ‘space bar’.
Next step is to enter the MySQL root password you created earlier and hit Enter.
The final step is to,
Open your a web browser window and enter the address http://localhost/phpmyadmin, and you can see a page displaying like below.
You can log in with the username root and the root password that you created earlier.
Before hitting COMMENT button, please fill * marked fields and the correct reCAPTCHA response.