Way to mount remote directory in linux and accessing it over apache

Plenty different ways are out there like Samba, NFS or FTP. I tried FUSE which uses SSH protocol.

Step 1: Install fuse-ssh in the system where you want to have remote directory.

Ubuntu: apt-get install sshfs
Redhat: yum install fuse-sshfs.x86_64

Step 2:  Enable password less SSH login
Make sure that you have openssh-server and openssh-client in your system. then issue 'ssh-keygen' command. Then copy id_rsa.pub generated to remote systems ~/.ssh/authorized_keys

Step 3: In /etc/fuse.conf  enable 'user_allow_other'
If you dont do this apache wont be able to access mounted directoy

Step 4: Mounting remote directory
sshfs -o allow_other, uid=1000, gid=1000, IdentityFile=~/.ssh/authorized_keys root@XXX.XX.X.XX:/var/www/html/JBrowse/data /var/www/data


Now you should be able to access data directory over apache.
To unmount the directory use: fusermount -u /var/www/data

Comments

Popular posts from this blog

Unzipping password protected files of Michigan Imputation Server

CollabNet: a Subversion client for Netbeans

Scatter Plot Matrix in Lattice: A way to join multiple scatter plot matrices in one plot