Saturday, September 24, 2011

Installing XAMPP on Linux Ubuntu 11.04 ..

Hey, i have installed Ubuntu 11.04 in my computer for web development. I want to learn about some open source technology to expand my skills. Yeah, i'm a little bit tempted with PostgreSQL, so i decided to install Ubuntu as the operating system.

To run Apache server for my web development tools, i need to have XAMPP running on my computer. Here's the step for the installation:
  1. Download the XAMPP for Linux (LAMPP) installer.
  2. Once the download is complete, place the file (.tar.gz) in your home/yourAccountName folder. For the example, if my account name is steve, so i place the file in steve folder inside the home (home/steve).
  3. Run the terminal (Ctrl + Alt + T) and  type sudo su and then insert your password. 
  4. After that, type tar xvfz xampp-linux-1.7.7.tar.gz -C /opt.
  5. When finished, your XAMPP already installed in your Ubuntu.. Congratulations..!!!
You can find the XAMPP file in FileSystem/opt/lampp.
To start the XAMPP, write this command to your terminal and don't forget to do this as root.
/opt/lampp/lampp start           ===>  For starting the XAMPP
/opt/lampp/lampp stop            ===>  For stopping the XAMPP



After done with the installation, there is still one problem. You can't copy anything to your htdocs folder. It's because you don't have any privileges to access this folder. You must grant this privileges to your account via terminal and as a root. Here is the step :
  1. Run the terminal (Ctrl + Alt + T) and  type sudo -s -H and then insert your password.
  2. Move to LAMPP folder,the command is cd /opt/lampp/etc/
  3. Type chown -R yourUsername:yourUsername htdocs in your terminal. Replace YourUsername with your username for Ubuntu. ex : chown -R steve:steve htdocs
  4. After that, go to the etc folder inside the lampp folder. The command is cd /opt/lampp/etc/
  5. Type gedit httpd.conf and it will open the httpd.conf file.
  6. Find the User Nobody in that file (User Ctrl + F) and change the Nobody with your Username and then save it. Here is mine : 

After that, restart your computer, open the terminal and start the XAMPP with this command : /opt/lampp/lampp start 

Now try to open the http://localhost in your browser, and you will see XAMPP page like this :


Try to copy any PHP or HTML file to htdocs and now you must can do it. Open the page in the browser and BOOM !!! , you will see your page. ^_^
Now your computer has a XAMPP installed on it.

Hopefully this post will help you. If you have more question, please let me know. Thanks and Regards..!!! ^_^

2 comments:

  1. In step 2; htdocs is located under /opt/lampp please correct that. In addition after doing these steps in phpmyAdmin i got " Existing configuration file (./config.inc.php) is not readable." To fix this first; "cd /opt/lampp/phpmyadmin" and then "/opt/lampp/phpmyadmin# chown YourUserName:YourUserName config.inc.php" Thanks for the post by the way it really helped me out =)

    ReplyDelete
  2. Hello Selo..
    Thx for visiting my blog and give some correction.. ^_^

    ReplyDelete