Installing LAMP on Ubuntu 8.10

LAMP stands for Linux, Apache, MySQL and PHP, all-in-one single package or bundle. LAMP is perfect for less experienced users and also for those who want to install everything in one go rather than install each component separately.

Since I’ve had experience using the WAMP package (in Windows) provided by ApacheFriends, here I will explain how to install their LAMP package in Ubuntu.

First you need to download their latest LAMP package from here. Make sure you keep the downloaded file on your desktop. Then open a new Terminal window (Applications -> Accessories -> Terminal) and enter the following commands. (The text in red should be changed to the exact name of the file you downloaded)

cd Desktop

sudo tar xvfz xampp-linux-1.6.8a.tar.gz -C /opt

Tha’s all. LAMP is now installed on your computer. All you need to do now is to start LAMP (this is to start the Apache server and MySQL). To do that execute the following command in Terminal:

sudo /opt/lampp/lampp start

You can test your installation by pointing your browser to http://localhost

Once you see the homepage, select English as your language and then you can check the installation status, phpInfo and documentations, etc.

Notes:

  • Your root (admin) password for MySQL is left blank. It’s better if you set a password.
  • Your php files and projects should be put inside the directory /opt/lampp/htdocs
  • Login to phpMyAdmin from here: http://localhost/phpmyadmin/index.php

UPDATE (13-11-2008)

In order to make sure LAMP starts automatically everytime you start your computer, follow these steps.

First, execute this command in Termina:

sudo gedit /etc/init.d/rc.local

When Gedit opens, add the following line right at the bottom of the file (below the word “esac”)

sudo /opt/lampp/lampp start

Save the file and close it. Now you don’t have to start LAMP manually each time your start your computer.

[Reference: ApacheFriends]

About these ads

37 Responses to Installing LAMP on Ubuntu 8.10

  1. Nick Lewis says:

    Hey there,

    I hit a snag with the setup, when I typed in the command to start the server I got a “command not found”.

    I’m using the exact same distro of LAMP as you also running 8.10.

    I restarted to see if it would start automatically, to no avail.

    Have any idea what the problem may be?

    Is there a way to get it to start when the machine turns on?

  2. nass says:

    @Nick

    You will get “command not found” if you typed like this:
    sudo opt/lampp/lampp start

    You forgot to put the slash before ‘opt’
    Try: sudo /opt/lampp/lampp start

    As for starting lampp when you start your computer, try this in Terminal:

    sudo gedit /etc/init.d/rc.local

    When Gedit opens, add the following line right at the bottom of the file (below the word “esac”)

    sudo /opt/lampp/lampp start

    Save the file and close it. Restart your computer and check if it works.

    I hope that helped.

    Cheers :)

  3. Nick Lewis says:

    @ nass

    hey, thanks for the reply.

    I did include the slash, I even tried without the slash just to see if it changed anything. Still, command not found.

    I’ll try the auto start when I get to the machine later today.

    Thanks for the awesome tutorial, it makes life a whole lot easier!

  4. nass says:

    @nick

    Did you extract the tar file to the /opt/ directory or a different one?

    Go to MyComputer -> Filesystem -> Opt -> Lampp, and see if there’s a file called ‘lampp’ inside it.

  5. Nick Lewis says:

    Hey again, sorry it’s been a while.

    The folder is there but there is no file named ‘lampp’ inside of it. There are many folders including modules, etc, phpmyadmin and so on…

    I followed the instructions you gave exactly.

  6. nass says:

    @nick

    If you still have the tar.gz file you downloaded, repeat the process again. It will overwrite the existing files inside the Lampp folder.

    Or you can extract the contents of the tar file to a temporary folder, and if the file ‘lampp’ is there, you can copy it to /opt/lampp/ and try again.

    If the file is still not there, I think you have to download the tar file again. ( http://www.apachefriends.org/download.php?xampp-linux-1.6.8a.tar.gz )

  7. Nick Lewis says:

    Aha, just tried to do it again, noticed the following errors in the terminal :

    gzip : stdin: unexpected end of file
    tar : Unexpected EOF in archive

    tar : error is not recoverable: exiting now

    I’m re-downloading now…

  8. Nick Lewis says:

    And…… YOU ARE THE MAN!!

    This tutorial is great. I installed LAMP (manually) on the previous version of ubuntu.. what a nightmare.

    Thanks for the good work!

  9. nass says:

    @nick

    You’re welcome. I’m glad you finally managed to get it to work.

  10. Nick Lewis says:

    Oh boy :)

    Yet another problem.

    I am able to view the default files in the /opt/lampp/htdocs/ folder just fine.

    At first I couldn’t paste any files in this folder so I did this in the terminal :

    sudo chown -R myuser /opt/lampp/htdocs/

    Then I could past files with no problem.

    Now when I got to http://localhost/test_folder in my browser it simply says that it cannot find the files… they do not exist.

    Am I placing the files in the correct folder? Have you any idea what I am doing wrong?

    haha.. thanks for all the help man!

  11. ColonelPanik says:

    Great! Works like a charm.
    All the info is now at localhost.

    After playing with LAMP for 3+ years and having
    zero success it now works.

    Thank you for pointing me to XAMPP.
    /°_°

  12. robert says:

    Hi,
    after downloading and tar i will test it.

    start firefox and run http://localhost

    i get a page with

    It works!

    nothing more
    i think it is the index.html in /var/www

    if i try

    http://localhost/phpmyadmin/index.php
    i get a

    Not Found

    The requested URL /test_folder was not found on this server.
    Apache/2.2.9 (Ubuntu) PHP/5.2.6-2ubuntu4 with Suhosin-Patch Server at localhost Port 80

    can you help ?
    thanks a lot
    Robert

  13. robert says:

    oh sorry, not the test folder message
    but this text

    The requested URL /phpmyadmin/index.php was not found on this server.
    Robert

  14. robert says:

    yes, i have rename the /var/www/ to /var/wwwsav, restart my ubuntu and get :
    The requested URL / was not found on this server.
    Robert

  15. roach says:

    ummmmmmmmm, i get this

    XAMPP: Another web server daemon is already running.
    XAMPP: Starting MySQL…
    XAMPP: Starting ProFTPD…
    XAMPP for Linux started.

  16. roach says:

    still cant access the phpadmin though

  17. nass says:

    @Nick Lewis
    Put the files inside the following directory:

    /opt/lampp/htdocs/xampp/

    @Robert
    You don’t have to rename that directory.
    After you restarted did you start LAMP? If you didn’t, the page won’t load. I have updated the article shortly after your comment (see above), it will help you to automatically start LAMP when you start your computer.
    Hope this helps.

  18. Vishal says:

    Thanks! its working for me

  19. Tim says:

    Hi, I was wondering if anyone knew why I would get the error below, I ran sudo tar xvfz xampp-linux-1.6.8a.tar.gz -C /opt
    and it looked like it was running fine until here:

    lampp/var/mysql/test/testac.MYD
    lampp/var/mysql/test/testac.frm

    gzip: stdin: unexpected end of file
    lampp/var/mysql/test/testai.frm
    lampp/var/mysql/test/testag.frm
    lampp/var/mysql/test/testag.MYI
    lampp/var/mysql/test/testag.MYD
    lampp/var/proftpd/
    lampp/var/proftpd/proftpd.delay
    lampp/var/run/
    lampp/RELEASENOTES
    tar: Unexpected EOF in archive
    tar: Unexpected EOF in archive
    tar: Error is not recoverable: exiting now

    When I try the command to start lampp:

    tim@tim-desktop:~/Desktop$ sudo /opt/lampp/lampp start
    sudo: /opt/lampp/lampp: command not found

    I tried this with two versions of lampp. Can anyone point me in the right direction to getting this error fixed? Thanks,

    Tim

  20. gorman20 says:

    … be carefull when securing your server…. as I have just found out it is extreamly easy to lock your self out of the admin
    @tim
    when you downloaded the file did you archive it by opening it? as this caused me problems in the past if so, re download and dont open the file just run it though terminal

  21. Tim2 says:

    Thanks for the tut… very clear and concise… worked like a charm!

    NOTE: Beware of the instructions on the apache friends site, where it instructs you to log in as root.. use the sudo command as instructed in this tutorial, and in place of su in any other tutorial, else play at your own risk.

    Thanks again!

  22. Binu Mathew says:

    I Installed the Xampp, and while i try to start the service it shows all the service asworking where as i try to load http://localhost/ it showing not found why?

  23. Binu Mathew says:

    Sorry,it get worked….the problem was iset mozilla firefox to work offline….

  24. Binu Mathew says:

    When i try to paste a folder in /opt/lampp/htdocs/xampp/ it cant able to copy why this is happening???please replay fast…..

  25. nitewalker says:

    I am confused about this install, I have used apache2 before and ran my own web server on this computer, but when I install this “xampp” install I cant’ find where the “apache2″ file is or where I need to be able to host my own web page….what am I not understanding or where do I need to go look to get back up? thanks….by the way the install went as advertised and am happy with that, but am confused about getting my web site back up? thanks again

  26. Dale says:

    That was awesome. So very very easy.

    Many thanks.

  27. rowena says:

    Hey when I try to type localhost/phpmyadmin/index.php it become a downloadable file Y? HElP

  28. rowena says:

    I installed Successfully! But I can’t access phpmyadmin.. What i’m gonna do noW??

  29. rowena says:

    Wat Just Clear your Browser Cache!! THANKS

  30. tibor says:

    short and fine!

    good tutorial, helped me a lot!

    Thx

  31. airtonix says:

    sudo tasksel install lamp-server

    is easier than this

  32. [...] [Note: In this post I'll be showing how to install Apache, php, MySQL and phpMyAdmin (one by one) on Ubuntu 8.10 using Terminal. If you want to install them all at the same time with minimal fuss, I recommend you to read my post on installing LAMP.] [...]

  33. Nery Besen says:

    Things you mentioned made . Yet, consider this, let’s say you integrated a little bit more? I am talking about, I do not want to tell you how you can write ur blog, however what if you actually added more stuff which can easily get people’s attention? Just simply as a video clip or simply a image or few to have viewers interested concerning what youve got to say.

  34. Very quickly this site will be famous among all blogging and site-building users, due to
    it’s good posts

  35. [...] [Note: In this post I'll be showing how to install Apache, php, MySQL and phpMyAdmin (one by one) on Ubuntu 8.10 using Terminal. If you want to install them all at the same time with minimal fuss, I recommend you to read my post on installing LAMP.] [...]

  36. Excellent way of telling, and fastidious piece of writing to take facts regarding my
    presentation subject, which i am going to deliver in university.

  37. […] [Note: In this post I'll be showing how to install Apache, php, MySQL and phpMyAdmin (one by one) on Ubuntu 13.04 using Terminal. If you want to install them all at the same time with minimal fuss, I recommend you to read my post on installing LAMP.] […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: