[HowTo] Install Apache, PHP, MySQL, and PHPMyAdmin on Ubuntu

After a while of not writing on my blog, I’m ready to start writing again. Probably you noticed that I changed my theme. Yes, I was busy redesigning my theme from the start. Anyway, I will tell you the story in the next article.

Now I want to show you how to install Ubuntu Karmic Koala 9.10 as a perfect server with Apache, PHP, MySQL and phpMyAdmin. Since Ubuntu has great repositories and the magic application called apt-get, it shouldn’t be hard to make Ubuntu a perfect server.

Okay let’s begin, please make sure your Ubuntu is connected to the internet:

1. Open your terminal and log in as root with this command:

su

2. Update your repositories list:

apt-get update

3. Install Apache:

apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils

4. Install PHP:

apt-get install php5 libapache2-mod-php5 php5-common php5-gd php5-mysql php5-imap php5-cli php5-cgi php-pear php-auth

5. Install MySQL:

apt-get install mysql-server mysql-client

Here you will be asked to input the root password for MySQL.

6. Install phpMyAdmin:

apt-get install phpmyadmin

Here you will be asked some questions to configure phpMyAdmin — just go through the wizard after it finishes installing.

7. Now your server is ready. Before you test please make sure to restart the server:

/etc/init.d/mysql restart
/etc/init.d/apache2 restart

8. Open the document root in /var/www, make a file called info.php and fill it with this:

<?php phpinfo(); ?> 

Then save the file.

9. Test the server with the browser and type the address http://[server-ip]/info.php

That’s it for now. Thank you for visiting my blog. I hope you enjoy. Have a nice day…