Thursday, January 2, 2014

Locally mirroring wiki and api docs of ROS under dropbox folder

Happy new year ROS world!

While recently I've been travelling so often like a sales person in a global company (that I'm not at all), I realized I could often appreciate if I had an access to ros web pages especially wiki and api docs even while I'm offline, and as a new mirroring method was just announced in a timely fashion for me, I built local mirror server. And also because I use multiple machines for development depending on my situation, it'd be even nicer if the data is synchronized, and I put it on dropbox folder. One down for new year's resolutions already.

Since I got stuck a little at a general web server setting, I thought I post how I did for and

1. If you have no problem in storing all the data under /var/www, you just follow these ros wiki to sync the data from to your computer. For, for Then as long as your web server (assuming apache2 on Ubuntu) is running, you can access them via http://localhost/ etc.

Since I wanted to store the data under dropbox folder, I needed the following tweaks:

2. Create a folder under your user directory, OUTSIDE of dropbox folder, where you're okay to share with OS' user or group www-data that apache2 is run by. Store all the wiki data there. What I do is to create `` folder first, then placed 2 directories into it, namely the structure looks like:
3. Change the owner or group of the folders and to www-data (only doing so for the group should do the trick).

4. Create a symbolic %YOUR_DROPBOX_DIR%/ to the one created above, so that dropbox synchronizes the data (AFAIK, dropbox on Ubuntu does trace up the symbolic links and sync data there. I'm not entirely sure yet -- now it's still being syncing).

5. Create a symbolic /var/www/ to the one created in 2.

6. Add following to /etc/apache2/mods-available/alias.conf

    # 1/2/2014 For local mirror.
    Alias / "/home/freshpastacooker/data/"
    <Directory "/var/www/">
        Options FollowSymlinks

7. Restart apache2 and now you can access those html pages by http://localhost/, http://localhost/, respectively.

This may seem a bit tricky -- the key is apache2 CANNOT refer to the symbolic link where ALL OF THE PARENT FOLDERS of the target is visible to its user, `www-data`.

Ok, now the boarding has begun for another flight. I'd appreciate any feedback!