Mar

3

In this article, I will share my experience install and configure LAMP on Ubuntu Linux.

1. Launch Terminal
First open up Applications->Accessories->Terminal.

2. Install Apache
Type the following line of command:

sudo apt-get install apache2

3.Install PHP5
Execute the following command by typing the following line in the Terminal and hit enter:

sudo apt-get install php5 libapache2-mod-php5

4. To Stop/Restart Apache
Execute the following command in the Terminal:

Stop/Restart Apache

5.Install MySQL Server

sudo apt-get install mysql-server

6.Set mysql root password
You’ll need to set a password for local computer gets root access.

a. First type the follwing line and hit enter to avoid being prompted for password:

sudo su

b. now you must kill the running mysql server. The process id is grabbed from /var/run/mysqld/ and inserted into the kill statement. Note there are ticks (`) around the process id, not single quotes (’).

kill `cat /var/run/mysqld/mysqld.pid`

c. Now you need to run a command to cause the server not to use the privilege system at all, which gives anyone with access to the server unrestricted access to all databases.


mysqld –skip-grant-tables & mysql -u root

d. Set the password:
UPDATE mysql.user SET Password=PASSWORD (’newpassword’) WHERE User = ‘root’;

e. execute the following commands one by one to finish the password setup.
exit
kill `cat /var/run/mysqld/mysqld.pid`
mysqld &
mysql -u root -p

7.Install MySQL Administrator

sudo apt-get install mysql-admin

8. Refresh Gnome Panel

killall gnome-panel

9. Install MySQL for Apache HTTP Server

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

10. To get PHP to work with MySQL, open the php.ini file

gksudo gedit /etc/php5/apache2/php.ini

11. Add the following line somewhere in the opened up file:

extension=mysql.so

12. Restart Apache
sudo /etc/init.d/apache2 restart

Now you are done!

Related Articles:
Install and Configure phpMyAdmin on Ubuntu LAMP
Create a Subdomain Virtual Host on Ubuntu



Similar Posts

Comments

Name (required)

Email (required)

Website

Speak your mind

7 Comments so far

  1. zirvap on March 12, 2008 7:12 am

    This is so far the most complete guide I have found. There are many instruction out there, your one is similar to the one i read at http://www.supriyadisw.net/2006/12/lamp-installation-on-ubuntu, but yours is far more precise. It’s like a combination of all the incomplete blog tutorials. Good job!

  2. Install and Configure phpMyAdmin on Ubuntu LAMP | highub.com - Open Source Web Development on March 14, 2008 10:26 am

    [...] you already have LAMP installed and configured on your machine, if not, please read this post - Install and Configure LAMP on Ubuntu [...]

  3. Create a Subdomain Virtual Host on Ubuntu | highub.com - Open Source Web Development on March 14, 2008 10:32 am

    [...] In this article, I will teach you how to create a virtual host named http://www.wordpress.example.com on your local machine, which will point to a local folder named wordpress under a specified location like /home/host/ on your machine. The wordpress folder will be your working folder for all the files run on the virtual host, and you’ll load the sample pages through http://www.wordpress.example.com. I assume that you already have LAMP installed and configured on your machine, if not, then read this article first: Install and Configure LAMP on Ubuntu [...]

  4. Siva shankari on August 23, 2008 2:50 am

    Hi, tis s a wonderful work.. bt, i want to know how to proceed after this in Ubuntu. How to launch LAMP in Ubuntu? Plz do help me, im totally new to both Ubuntu and LAMP. Im getting ample info. for XAMP installation. bt, nothin regarding LAMP.

  5. admin on August 24, 2008 2:52 am

    hi, Siva shankari maybe you can read Related Articles - Create a Subdomain Virtual Host on Ubuntu, it teaches you how to actually run PHP code and execute it from browser.

  6. rakesh on September 28, 2008 8:43 am

    really really helped me .. thank you very much..

    regards
    rakesh

  7. Pradeeban on December 17, 2008 10:33 pm

    Wonderful job. Keep it up.. Regards…

Sponsors




Links