XAMPP(Webserver) On Linux

Posted on August 8, 2008

I recently erased Fedora 9 from my hard drive, and installed Linux Mint. Im enjoying it so far but it didn’t come with a webserver. Heres a little tutorial on how to install XAMPP and get it up and running.

First of all, download XAMPP from sourceforge. As of writing this, the latest version is 1.6.7 so ill be referencing to that in the tutorial. Save it to your /home/$USER/ directory.

Extract the archive to your /opt/ directory.

sudo tar xvfz xampp-linux-1.6.7.tar.gz -C /opt

Now its installed :)
To start it:

sudo /opt/lampp/lampp start

To stop it:

sudo /opt/lampp/lampp start

To launch the panel/manager:

sudo /opt/lampp/lampp panel

You can test if its on by going to http://localhost

To add files to the server, you would need to put them in /opt/lampp/htdocs/ but since that directory is owned by root, your user doesn’t have neccesary privilages. The easiest way to “get around” this is to set up a symlink folder in your home directory. You may be familiar with public_html or www directories on your webhosting, we are basically setting the same thing up here.

First we want to set up the directory we are going to link to in htdocs. So..

sudo mkdir /opt/lampp/htdocs/homefiles/

Then make the equivilant directory in our home directory.

mkdir ~/public_html/

And finally link them together.

sudo ln -S ~/public_html/ /opt/lampp/htdocs/homefiles/

So now we can put PHP files/whatnot into our ~/public_html/ folder and they will show up in localhost/homefiles/

8 Responses

  1. Michael
    August 8, 2008

    The path can be different, mine was in the /etc/ directory.


  2. Stephen Groom
    August 9, 2008

    XAMPP sucks :P use lighttpd


  3. jerik
    August 28, 2008

    jerik@jerik-laptop ~ $ ln -S ~/public_html/ /opt/lampp/htdocs/homefiles/
    ln: «/opt/lampp/htdocs/homefiles/»: hard link not allowed for directory

    jerik@jerik-laptop ~ $ sudo /opt/lampp/lampp panel
    Traceback (most recent call last):
    File “xampp-control-panel.py”, line 21, in
    import gtk
    File “/var/lib/python-support/python2.5/gtk-2.0/gtk/__init__.py”, line 48, in
    from gtk import _gtk
    ImportError: /usr/lib/libcairo.so.2: undefined symbol: FT_GlyphSlot_Embolden


  4. jerik
    August 28, 2008

    what I meant with the last comment is, can someone help?


  5. Lerock
    September 17, 2008

    Jerik, try to put “sudo ln -s ~/public_html/ /opt/lampp/htdocs/homefiles/” with -s option in lowercase.

    Good luck ;)


  6. Alex
    September 20, 2008

    @Jerik
    I had the same problem. Was able to start the panel by entering the following two lines:

    > cd /opt/lampp/share/xampp-control-panel
    > .xampp-control-panel


  7. Alex
    September 26, 2008

    @Jerik again:

    The command for a symlink needs to be like so:

    sudo ln -s ~/public_html/ /opt/lampp/htdocs/homefiles/

    Note that it’s a lowercase s and not a capital.


  8. Alex
    September 26, 2008

    Ooops - didn’t notice your post Lerock *blush*


Leave a Reply

You must be logged in to post a comment.