Installing Apache,PHP,MySql,phpmyadmin on ubuntu server

Simply run these commands from terminal

Update the Package

sudo apt-get update

 

Install Apache2

sudo apt-get install apache2

 

Install PHP5

sudo apt-get install php5

sudo apt-get install libapache2-mod-php5

 

Install MySQL

sudo apt-get install mysql-server 

lib apache2-mod-auth-mysql php5-mysql

 

Install PhpMyAdmin

sudo apt-get install phpmyadmin

You just installed phpmyadmin, but you also need to tell apache where to find phpmyadmin. phpmyadmin already comes with an apache configuration and we just need to use it. This configuration is available in: /etc/phpmyadmin/apache.conf

Add the following line to the end of /etc/apache2/apache2.conf:

Include /etc/phpmyadmin/apache.conf

Restart Apache2

sudo /etc/init.d/apache2 restart
or execute service apache2 restart

Now your web services is ready. You can upload your files into /var/www/ directory.

 

To install php5 library for mysql run this command

sudo apt-get install php5-mysql