Setup and run XAMPP in your home directory

We tend to be old skool people and with every release of our favorite distro we just overwrite the / rather than opt for the upgrade route and it works pretty well because there always is a separate /home/ where all our heart is.

Unfortunately XAMPP (yeah we need it to be there on every desktop far a variety of reasons) installs itself in /opt/ and no we do not have a separate /opt/ (don't ask why ;) )

The following is more of a 'Hack Note' to myself than a complete HOWTO but there is nothing more to it really....

  1. Uncompress XAMPP and put it in a suitable directory (I have put it in my home directory /home/amit/lampp).
  2. Now logged in as 'root' and proceed further by creating symbolic link of your XAMPP installation into /opt/ directory
  3. CODE:
    1. [root@amit ~]# ln -s /home/amit/lampp/ /opt/

  4. Change permission on phpMyAdmin's configuration file
  5. CODE:
    1. [root@amit ~]# chmod 644 /opt/lampp/phpmyadmin/config.inc.php

  6. Change ownership and permissions on mysql directory where database tables reside
  7. CODE:
    1. [root@amit ~]# chown nobody:root /opt/lampp/var/mysql/
    2. [root@amit ~]# chmod 775 /opt/lampp/var/mysql/

  8. Finally change ownership and permissions on database tables directories
  9. CODE:
    1. [root@gateway ~]# chown nobody:root -R /opt/lampp/var/mysql/cdcol/ /opt/lampp/var/mysql/mysql/ /opt/lampp/var/mysql/phpmyadmin/ /opt/lampp/var/mysql/test/
    2. [root@gateway ~]# chmod 660 /opt/lampp/var/mysql/cdcol/* /opt/lampp/var/mysql/mysql/* /opt/lampp/var/mysql/phpmyadmin/* /opt/lampp/var/mysql/test/*

  10. Also if you like to put your projects in your 'public_html' directory then rename/remove 'htdocs' of lammp and create another sym link
  11. CODE:
    1. [root@amit ~]# ln -s /home/amit/public_html/ /home/amit/lampp/htdocs

    Lastly I would like to say that the correct way should be to just have a separate /opt/ partition which you do not format while you upgrade, but if you want your XAMMP to be in your home directory this is a way to have it


About this entry