How to configure Ubuntu and LAMP on Windows

Hello all Linux freaks,

Having already looked upon how to configure Apache-PHP-MySQL on Windows, now here I will try to explain in short how to do the same on Linux OS. I personally don’t have a seperate machine for linux. I run Ubuntu on my Windows machine using VM Ware. So before we go on to see how to configure LAMP on Ubuntu, lets see how can we have Ubuntu running on Windows.

  • For this tutorial I have used VMware-player-2.0.2-59824.exe for VM Ware installation and Ubuntu-7.04-desktop-i386.zip for Ubuntu. You will need to download the same from http://www.vmware.com/download/player/ and http://www.ubuntu.com/GetUbuntu/download
  • Install VM Ware, which is the most simple installer as you can get. At the end it will ask you to reboot the machine and kindly do not skip this step.
  • Now, open VM Ware which you have just installed and you should see something like this:

  • Now click the open button and browse to the folder where you have unzipped the Ubuntu zip file.

  • Click open Ubuntu-7.04-desktop-i386.vmx and thats it. You have just installed and configured Ubuntu on Windows. Simple, Isn’t it ? You should be seeing something like this by now:

For my system, Ubuntu automatically picked up various internet settings. However when I tried running the same from my office, I had to make appropriate changes for proxy setting. Kindly do the same for running internet on your Ubuntu.

Now an important thing before we proceed:

  1. The default administrator password for Ubuntu is ubuntu
  2. By default you are not the admin or root user. Hence you will need to prefix sudo or su to run a command as administrator in the Ubuntu terminal.

Also, before we proceed further kindly check if your Ubuntu is configured correctly for internet connection. Just check by opening this blog through mozilla in ubuntu. If it works, you are all set to configure LAMP on ubuntu.

Follow the following steps to configure LAMP on ubuntu (you need to run a few commands on your terminal window)

  • Open file at /etc/apt/source.list and uncheck the box for install from CD. This will let ubuntu install all modules directly from the repository.
  • $ sudo apt-get upgrade
  • $ sudo apt-get update
  • $ sudo apt-get install mysql-server mysql-admin apache2 php5 libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql phpmyadmin
  • $ sudo mysqladmin -u root password [YOUR_NEW_PASSWORD]
  • $ sudo /etc/init.d/mysql restart
  • $ sudo /etc/init.d/apache2 restart

Thats pretty much we need. Now let us test our configuration and LAMP setup.

  1. $ sudo vim /var/www/phpinfo.php
  2. Type in the following few lines of code in the file:
    <?php
      phpinfo();
    ?>
  3. Open up your browser and type in http://localhost/phpinfo.php
  4. If you are able to see the php config file information on your browser. Thats it.
  5. Next type http://localhost/phpmyadmin
  6. Login as root i.e. Username : root and Password : [YOUR_NEW_PASSOWRD]
  7. If you are lucky enough you will see the phpadmin console.

Congratulations ! Thats pretty much what exactly we need. Now go on to do all your web development on Linux. Hail Windows 😉

I configure all this stuff long back, so if I have missed out on some issues kindly lemme know and comment the same.

  • Pingback: How to get started with web development? | Abhi's Weblog()

  • Pingback: Memcached and “N” things you can do with it - Part 1 « Abhi’s Weblog()

  • Rajkumar

    hi Abhinav,

    while trying to configure LAMP as per the above tutorial I am having problems opening the file “Ubuntu-7.04-desktop-i386.vmx”. it says something like the file is too large and is not supported by the host file system.
    please help.

    below is the exact error mesg

    “VMware Player cannot open one of the virtual disks needed by this VM because it is larger than the maximum file size supported by the host file system. Some remote file systems do not support files larger than 2 GB, even though the file system on the server might.
    Cannot open the disk ‘D:Ubuntu-7.04-desktop-i386Ubuntu-7.04-desktop-i386.vmdk’ or one of the snapshot disks it depends on.
    Reason: The file is too large.”

    ——–

  • Rajkumar

    Im having FAT32 filesystem on all my drives expect C drive which is NTFS. do you think NTFS is a problem. the file which the player is trying to open(Ubuntu-7.04-desktop-i386.vmx) is about 2.3 GB and the filesystem supports a max of 2GB (as per the error message). please let me know if you have encountered similar issue anytime.