Configure & Run XAMPP on Ubuntu Linux
I like to keep posts as simple as possible, so don’t mind me writing things fast — there is comments section below where you can feel free to ask anything related ;)
You probably installed XAMPP already and then came here for help, but let’s cover that part too. Go to our beloved Google.com and search “install xampp on linux”. First result that appears, click on it and follow steps on ApacheFriends’ website. Download from first link in the table (at time of this post it was “XAMPP Linux 1.7.7”, size 77MB).
Follow step 2.
Now, if you get stuck at >
/opt/lampp/lampp start, do this:
sudo service apache2 stop(if you are logged as SU, omit “sudo” part)
Also, you can stop mysql service, same as above but instead apache2, type “mysql”.
This is because Ubuntu Linux (or any) has it’s own Mysql and Apache servers installed. Kill them to use XAMPP’s ones.
Now type in console:
sudo /opt/lampp/lampp start
…and type in browser http://localhost and you’ll see XAMPP live and running. But here we have problems which you need to solve by yourselves. Go to //localhost/phpmyadmin and you will get “Existing configuration file (./config.inc.php) is not readable.”. This is because you need to set permissions for your username. Go to Phpmyadmin folder (> cd /opt/lampp/phpmyadmin).My username is markzero, and command to run was:
sudo chown markzero:markzero config.inc.php(so obviously instead “markzero” put your username)
Now we also need to set some ownerships, and permissions to htdocs folder inside XAMPP, otherwise we won’t be able to FTP files into it, and/or to copy. Go to /opt/lampp folder (> cd /opt/lampp). Write this piece:
sudo chown -R your-username:your-username htdocs
…and…chmod it to 755:
sudo chmod -R 0755 /opt/lampp/htdocs
And nope, it is not yet done. We need to change /opt/lampp/etc/httpd.conf file to reflect our ownership change. While in /opt/lampp folder, type:
sudo gedit /opt/lampp/etc/httpd.conf(fixed)
— User nobody
— Group nogroup
Note: it might not write “nobody” or “nogroup” but find that module, there aren’t two of them. Change “nobody” to your username, in my case it is “markzero”. Restart your mysql and apache2 services as explained above in beginning, and it should all work!
Now create some folder inside /lampp/htdocs and copy some files through FTP to it. Success! All is working: FTP, write permissions and ownerships.
Start (approximately) from scratch before this tutorial to be sure you followed exactly as I wrote. Let me know if you run into issues! ;)
Share this story:
15 responses to “Configure & Run XAMPP on Ubuntu Linux”
Leave a Reply