Beginner’s guide to setting up Apache2, PHP5, and MySQL
The following are beginners instructions on how to install Apache2, PHP5, MySQL, and PHPMyAdmin in one swoop. I tried to simplify the process as much as possible. This should work for all distributions (although I have only tested it on Ubuntu). Copy and paste the following command into a terminal:
apt-get install mysql-server mysql-admin apache2 php5 libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql phpmyadmin
Once all these programs finish installing, you can go to /var/www and anything you put in /www will appear on your server. Open a browser and type “localhost” into the URL and you will see all the files on your server. There should only be two links in your localhost at this point: apach2-default and phpmyadmin.
Before you can begin using MySQL you need to give yourself permission to log into PHPMyAdmin. You can give yourself root access to begin with by typing the following command (obviously replace “yourPassword” with the password you want):
mysqladmin -u root password yourPassword
After you setup your access to PHPMyAdmin you need to restart your server and then you can log in. Type the following commands to restart MySQl and Apache2:
/etc/init.d/mysql restart
/etc/init.d/apache2 restart
Go to localhost/phpmyadmin and log in and you will be able to add databases to MySQL. Let me know if you have any questions and I’ll address them in the comments.

















This is surely a beginner’s guide. Not bad for a quick-setup; however, a lot of detail into how things are configured and used are left out. Nice job all the same.
I would agree with only_samurai, other than this:
I have a major noob problem, in that after installing php, apache and mysql first (and phpmyadmin later) i just get a standard apache test page when i log in. this tutorial only covers if everything works perfectly.
Thanks for the efoort. Please not the following :
1. easy,clear .
2. Something is missing for a beginner . this is the steps prior to the following command :
user01@user01-desktop:~$ mysqladmin -u root password Yourpassord
because the followingresponce will appear :
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@'localhost’ (using password: NO)’
Hi,
I am the student of Master of Computer Management. I want some specific topics like how to configure apache server and how to install it- with or without rpm? and i also want the mysql admin commands?
Hi,
I am the syudent of master of computer management. i want the help releted to some special topics in linux like how install apache server – with or without rpm? and mysql admin commands? can you help me with this?