Installing LAMP on Ubuntu 12.04

 

"LAMP is a solution stack of free, open source software. The acronym LAMP refers to the first letters of Linux (operating system), Apache HTTP Server, MySQL (database software) and PHP -- principal components to build a viable general purpose web server." -- LAMP wiki article

Though, the letters M and P could also stand for MariaDB, Perl and Python respectively, this was made as a guide to install and configure Apache, MySQL and PHP on Ubuntu 12.04



Installing Apache webserver

1. Press Ctrl + Alt + T , to open the CLI.

2. Type sudo su to access root / admin privileges, and input your password.

3. Type apt-get install apache2

4. Upon installation restart your apache webserver by typing the following command: service apache2 restart

5. Go to your browser, and type localhost in the address bar. If this screen appears, you have installed apache.


Installing MySQL

1. In your CLI, type apt-get install mysql-server

2. This screen would appear, for this guide, I'm going to set root and root for the root username and password respectively. You will successfully install MySQL afterwards.


Installing Php

1. In your CLI, type apt-get install php5

2. After installation go to your apache webserver folder by typing cd / and cd /var/www/

3. Create a file called info.php by typing nano info.php

4. In the text editor, type <?php phpinfo(); ?> and save your file.

5. Go to your browser and type localhost/info.php you should be able to see your php version and the various plug-ins it came along in its installation.


At this point you have successfuly installed LAMP on Ubuntu 12.04. gz.