Using Xampp with Dropbox on linux

In a previous post I published a guide on how to configure XAMPP to work with Dropbox on Windows. Now we can see how to configure it to work on linux.

Beware, if you have existing projects, make backups for precaution. I have tested this configuration on Ubuntu and everything works, but I don’t know if other distributions may arise several problems.

First you need to install dropbox following the instructions that are given on the site. Now install xampp and go to the following directories and edit the files with root permissions:

FILE TO EDIT: /opt/lampp/etc/httpd.conf
Find:

User nobody (or User daemon)
Group nogroup (or Group daemon)

and replace with:

User YOUR ACCOUNT NAME
Group nogroup

note: replace YOUR ACCOUNT NAME with your login name
Find:

DocumentRoot "/opt/lampp/htdocs"
<Directory "/opt/lampp/htdocs">

and replace with:

DocumentRoot "/home/YOUR ACCOUNT NAME/Dropbox/htdocs"
<Directory "/home/YOUR ACCOUT NAME/Dropbox/htdocs">

FILE TO EDIT: /opt/lampp/etc/my.cnf
Find:

user = nobody

or

user = mysql

and replace with:

user = mysql
datadir = /home/YOUR ACCOUNT NAME/Dropbox/mysql/data

Find:

innodb_data_home_dir = /opt/lampp/var/mysql/

and replace with:

innodb_data_home_dir = /home/YOUR ACCOUNT NAME/Dropbox/mysql/data

Find:

innodb_log_group_home_dir = /opt/lampp/var/mysql/

and replace with:

innodb_log_group_home_dir = /home/YOUR ACCOUNT NAME/Dropbox/mysql/data

FILE TO EDIT: /opt/lampp/etc/extra/httpd-SSL.conf
Find:

DocumentRoot "/opt/lampp/htdocs"

and replace with:

DocumentRoot "/home/YOUR ACCOUNT NAME/Dropbox/htdocs"

Copy your direcotory htdocs (/opt/lampp/htdocs) in dropbox directory: /home/YOUR ACCOUNT NAME/Dropbox/htdocs/  and data (/opt/lampp/var/mysql) in dropbox directory: /home/YOUR ACCOUNT NAME/Dropbox/mysql/data/
Now if you try to access your projects from localhost/YOUR PROJECTS might have permission error, so you have to give permissions to directory and subdirectories just created/moved. I used

sudo chown YOUR ACCOUNT NAME:mysql -R /home/YOUR ACCOUNT NAME/Dropbox/mysql/

sudo chown YOUR ACCOUNT NAME:YOUR GROUP NAME -R /home/YOUR ACCOUNT NAME/Dropbox/htdocs/

sudo chmod 774 -R /home/YOUR ACCOUNT NAME/Dropbox/mysql

sudo chmod 774 -R /home/YOUR ACCOUNT NAME/Dropbox/htdocs

Now everything should work.

After synchronizing all of our project data on Dropbox, we could work on the same projects both on windows and on linux, being careful, however, to use the same versions of mysql, and then the same versions of xampp on both operating systems. I noticed that moving from windows to linux, issues arise mysql file permissions, so each time you make changes from windows and return to work on linux, you have to give these permissions.

sudo chown YOUR ACCOUNT NAME:mysql -R /home/YOUR ACCOUNT NAME/Dropbox/mysql/

Attention. It is NOT possible to work simultaneously from different computers on the same projects.

11 thoughts on “Using Xampp with Dropbox on linux

  1. I have problem with phpmyadmin
    #2002 – No such file or directory
    The server is not responding (or the local server’s socket is not correctly configured)

    Thanks :)

  2. Hi

    I tried following your instructions and to be fair it was very easy.

    However, i try to go to localhost and all I get on my websites is ‘error connecting to database’. In addition, i can not access phpmyadmin any more.

    I keep getting the following error:

    #2002 – No such file or directory
    The server is not responding (or the local server’s socket is not correctly configured).

    Any ideas?
    Im using Xampp with Ubuntu 14

  3. Hi Andrea,
    Thank you for a useful tutorial. It was very straightforward and easy to follow.

    I am however having one challenge with my installation, that I have not been able to resolve on my own. When I go to the phpmyadmin log in page, I am unable to log in as I keep getting the following error message: “#2002 Cannot log in to the MySQL server”. For some reason the mysql server is not starting or at least does not stay on when started. The following is what I get at the command line terminal when I run: sudo /opt/lampp/lampp start.
    Starting XAMPP for Linux 5.6.3-0…
    XAMPP: Starting Apache…ok.
    XAMPP: Starting MySQL…ok.
    XAMPP: Starting ProFTPD…ok.
    Then when I run: sudo /opt/lampp/lampp stop, I get the following:
    Stopping XAMPP for Linux 5.6.3-0…
    XAMPP: Stopping Apache…ok.
    XAMPP: Stopping MySQL…not running.
    XAMPP: Stopping ProFTPD…ok.

    I am running xampp-linux-x64-5.6.3-0 on Ubuntu 14.04 LTS and xampp-win32-5.6.3-0 on Windows 7 Prosessional x64. The Windows installation and interaction with Dropbox works well, however, as I said before, I can’t log in to the MYSQL server.

    Any ideas on what I may try to resolve this issue?

    Regards,

      • Hi Andrea,
        Thank you for responding. I have tried to shut down apache and mysql from both the Ubuntu and Windows7 machines, but the result is the same.
        When I change back the settings for the data_dir, innodb_data_home_dir and innodb_log_group_home_dir to their default settings in the /opt/lampp/etc/my.cnf file, the mysql server turns on.

        I have re-checked like a million times to see if I some how had done something wrong, but I am not picking up any errors.

        Any other suggestion is welcome.

        Regards,

Leave a Reply