Saturday, January 30, 2010

How to install LAMP on ubuntu

Start install Apache:
1. Open the terminal (we will be using it through most of my guide) from Applications > Accessories > Terminal

2. Install apache2 using apt-get by typing the following

Quote : sudo apt-get install apache2

Note that you should know the root password.
Now everything should be downloaded and installed automatically.

To start/stop apache2 write:

Quote : sudo /etc/init.d/apache2 start
Quote : sudo /etc/init.d/apache2 stop

Your www folder should be in: /var/www/

Then install PHP / PHP5:
1. Also in terminal write:

Quote : sudo apt-get install php5 libapache2-mod-php5

Then install MySQL:
1. In terminal execute :

Quote : sudo apt-get install mysql-server

2. (optional) If you are running a server you should probably bind your address by editing bind-address in /etc/mysql/my.cnf and replacing its value (127.0.0.1) by your IP address

3. set your root password (although mysql should ask you about that when installing)

mysql> SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(‘xxxxxx’);

4. Try running it

mysql -u root -p xxx

where xxx is your password.
Note: You can install PHPMyAdmin for a graphical user interface of MySQL by executing

Qoute : sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin


Enjoy ubuntu... ;)

No comments:

kunkun-laptop .... ;)