This guide will cover installing and updating Apache 2, MySQL 5 and PHP 5 on Debian Linux.

Step 1. To start with, its important to make sure apt-get is the latest version.

apt-get update && apt-get upgrade

* This line will update your aptitude to the latest version information and then upgrade the applications on your computer.

Step 2. Next, lets install Apache2.

apt-get install apache2

* This will install and provide basic configuration for apache2.
*  The default web directory will is /var/www and the Apache 2 configuration can be found in /etc/apache2/.

Step 3. Next, lets install PHP5 with MySQL5 (Database engine), Curl (HTTP tool):

apt-get install libapache2-mod-php5 php5-curl php5-gd php5-mysql

Step 4. Next, lets  install MySQL 5 server + the MySQL client.

apt-get install mysql-server mysql-client

* The configuration file can be found at /etc/mysql/my.cnf

Step 5. Now we need to add a Password to the ‘root’ MySQL user.

Deb:~# mysql -u root

mysql> UPDATE `mysql`.`user` SET Password = PASSWORD(‘my password’) WHERE user = ‘root’;
mysql> FLUSH PRIVILEGES;
mysql> exit

* Remember your password, as you will use it to add MySQL users in PHPMyAdmin later

Step 6. install PHPMyAdmin.

apt-get install phpmyadmin

* This will automatically configure Apache2 for us.

Step 7. Restart apache.

/etc/init.d/apache2 restart

*  Now you will be able to log in to PHPMyAdmin:

http://localhost/phpmyadmin/

Done