Install Apache2, MySQL5, PHP5 and PHPMyAdmin on Ubuntu

September 20th, 2009 by Ahmed Tawfik Leave a reply »

This is a collection of guide how to Httpd Web Server complete with latest (as mod), MySQL for Ubuntu. As a bonus, I even through in an additional guide to . Please do note that most of this guide can be found elsewhere which is listed at the bottom of the guide.

Getting Started

I’m sure everyone here is familiar on how to use Terminal which is available from:

Applications > Accessories > Terminal

Httpd Web Server

To , type the following command into your Terminal:

> sudo apt-get  apache2

Testing

Paste the following command into your Terminal

> sudo /etc/init.d/apache2 start

Then open http://localhost/ or http://127.0.0.1 from your web browser. At first run, you would probably see a directory listing or a HTML page with a text saying “It’s Work“.

It’s Work


To browse the file please navigate to the following folder

> cd /var/www/

Similar to , all you need to do is type the following command in your Terminal:

> sudo apt-get  php5 libapache2-mod-php5

After the installation is complete, do restart your Http Web Server.

> sudo /etc/init.d/apache2 start

This allow to be include as mod.

Testing

A simple way to test your is via phpinfo() function which display all related configuration of your . To do so type the following command in your Terminal.

> sudo gedit /var/www/phpinfo.

This will open gEdit text editor which you will type in

Open http://localhost/phpinfo. in your web browser and you will get something like this:

You should see all of the info about your installation listed on the page.

MySQL

Again, type the following command in your Terminal

> sudo apt-get  mysql-server

Note: As MySQL is installing, it will ask you to configure your root password. Make sure that you type it correctly, as it will only ask you once.

You might need to manually start MySQL for the first time, do so by typing this command in your Terminal.

> sudo /etc/init.d/mysql start

Testing MySQL

After that is finished, you can test MySQL by running this, where 123 is your password

> mysql -uroot -p123
mysql> show databases;
mysql> quit

As usual, run the following command in terminal

> sudo apt-get  

This process is quite, as slow as MySQL installation and there are time you need to provide some information in order to complete the process but it quite optional. Once finish you need to create a soft link in /var/www/ to /usr/share/ using these command.

> sudo ln -s /usr/share/ /var/www/

Now open up http://localhost/ your web browser.

Copyright  crynobone.com

Tags: , , , , , , , , , , ,
Advertisement

Leave a Reply