XAMPP with Ubuntu

If you want a nicely compiled web server to use for testing, nothing beats XAMPP. And if you use Windows, it’s even nicer with XAMPP Lite. It’s so convenient, you can even run the server from a USB thumb drive.

However, I’ve learned recently that Linux doesn’t have quite as many convenient options. If you wish to set up a web server on Linux, there are countless tutorials across the net on doing it. For me, I just wanted something that I could run and test some things when I needed to without having to upload it to a production web server. Not to mention, it’s faster when everything is on a local machine. I was hoping that a XAMPP Lite setup had been released for Linux, but I was unfortunately wrong. Unlike Windows, Linux would require XAMPP to be installed in the /opt/ directory, which is owned by root. This means my system user wouldn’t be able to access the directory and directly alter files/folders, at least not without steps that extend beyond the directions given on the XAMPP website.

First off, I followed the directions for installing XAMPP exactly as described on the website. At first glance, everything looks fine. However, once I tried to access FTP using the default nobody user, I realized something was wrong. It gave me a 550 permissions error. Initial searching online seemed to indicate that the error wasn’t typical with others, so I figured something must have gone wrong with the installation. I had also installed the most recent beta version. I decided to uninstall, download the latest non-beta version and install it. Everything, again, went as expected with no errors. Again, I logged in via FTP and found that I could not create directories or alter files due to insufficient permissions. Doing a little more troubleshooting, I found that the lampp/htdocs folder was actually solely owned by root, instead of being owned by the user nobody and the root group. The nobody user had no ownership of the directory or its contained files/folders and therefore no permissions to affect it. I logged into root via terminal and changed ownership of the lampp/htdocs to nobody and from there everything worked fine accessing the directory via FTP.

A different approach would have been to change ownership of the directory to my own system user, this way I could directly alter the files/folders through nautilus without even having to run the proFTPD server. Since I am using the web server for testing locally anyway, this would have been the way to go.

For reference, here are the terminal commands used.

For listing ownership of files within a directory:

ls -l <path>

If you are already within the directory for which you want to list ownership of subsequent files and folders, you can leave the <path> value empty.

For changing ownership of the htdocs directory:

chown -R <username>:<usergroup> /opt/lampp/htdocs

Using your username for both the <username>  and <usergroup>  values will be fine.

The reason I recommend XAMPP over other Linux web server packages for using as a test server is that it is the easiest to uninstall that I have seen. Deleting the /opt/lampp directory is all that has to be done for complete removal.