• Home
  • About Me
  • Musings
  • Programming
  • Open Source
  • Computers
  • Society
  • Books
  • Design
  • Movies
  • Installing LAMP in Ubuntu

    Posted on April 27th, 2009 by Rajeshwaran S P

    Following are the steps to get Apache, MySQL and PHP installed on a Ubuntu system.

    Installing Apache:

    In the terminal window issue the following command

    1
    
    sudo apt-get install apache2

    To test if Apache has installed successfully, open a browser and browse to http://localhost. A message “It works” will be displayed.

    Installing PHP

    In the terminal window issue the following command

    1
    
    sudo apt-get install php5 libapache2-mod-php5

    Once the installation is complete, to get php working, restart apache server by issuing the following command

    1
    
    sudo /etc/init.d/apache2 restart

    To test that PHP has been successfully installed, quickly create a test PHP script

    1
    
    sudo gedit /var/www/test.php

    In the gedit window, type a script and save the file

    Open up a browser window and open the test.php file created. The PHP application environment information will be displayed.

    Installing MySQL

    In the terminal, run the following command

    1
    
    sudo apt-get install mysql-server

    That should get mysql installed. You will be prompted for a ‘root’ db user password. Enter it.
    To test mysql, in the terminal issue,

    1
    
    mysql -u root -p

    Enter the root user password for mysql server. You will be launched into the mysql prompt.

    Installing phpMyAdmin

    To install phpMyAdmin, issue the following command at the terminal

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

    To test phpmyadmin, open a browser and navigate to http://localhost/phpmyadmin.
    Thats it!

    Possibly Related posts:

    1. Dual booting Ubuntu and XP Starting out on the Open Source fever, I installed Mandriva,...
    2. Installing Rails : Local gem install After a unsuccessful installation of rails that took nearly 5...
    3. How to open, extract and use RAR files in Ubuntu Archive Manager in Gnome does not support .rar files by...
    4. Ubuntu Panel Missing! When I logged into the machine today, I was shocked...
    5. My PC Here’s a list of what is there in my PC,...

    Tags: , ,

    2 Responses to “Installing LAMP in Ubuntu”

    1. Prerana said :

      So you are really serious about your free software pledge! Good tips.

    2. Rajeshwaran S P said :

      Ya! So now my system has only Linux. Goodbye Windows!!!

    Leave a Reply