Apache Document Root on External HD
There is a kick ass program called sshfs. It uses the fuse module to mount a remote directory, via ssh, on the local computer. To begin simply create a folder, on your local computer, that you will use as the mount point of your external directory. Then install sshfs. Debian distributions have it in the repositories: sudo apt-get install sshfs The command is used basically the same way as ssh, and scp. To mount an external directory you can do the following: sshfs user@othermachineip:/directory /home/user/remotedirectory The apache configuration option “documentroot” only can take a local directory as a value. To compensate, you can create a locally mounted remote partition, via sshfs, for use as an apache document root. In this way you will be using one computer as the web server, and a completely separate computer for file storage. Personally, I think this is useful if a web service you offer allows uploads, and you want to have an external location to store them as to not clutter the server hard drive



November 18, 2009 - 3:26 pm
I’m having a hard time getting Apache to play nice with sshfs. After changing the docroot of Apache and reloading, Apache was fine. But once I found a directory in that Apache docroot via sshfs, I receive a 403 Forbidden error, even with permissions of 755.
Am I missing something?
November 18, 2009 - 5:17 pm
Permissions are always a pain in the neck. Make sure the folder, and all the contents are owner by Apache. The user and group of apache is www-data. Do:
sudo chown -R www-data:www-data docrootWhere docroot is the apache folder with the index html file.
Then chmod the file recursively again. Check the changesd with
ls -lJanuary 27, 2010 - 10:20 am
is not possible to set permission over sshfs so i have the same problem, i’ m not able to use apache+sshfs