MindTouch Developer Center > Deki > FAQ > File Management > How do I...Store my files on a Windows shared network drive?

How do I...Store my files on a Windows shared network drive?

Table of contents
No headers

Contributed by Stefferdwiki

To store attachments on a windows shared network drive using the VM version of Deki:

Open a console and log in as root.

Install smbfs since smbmount isn't available default:

Code:
apt-get install smbfs
Before we can mount the network share, we first need to determine the uid and gid deki is running under:

Code:
ps aux
Also, check in the output under which name the process /usr/bin/mono runs (with me it is "www-data").

If you run the following command, column 1 is the username, 2 is the password, 3 is the UID, and 4 is the GID.:

Code:
cat /etc/passwd | grep www-data
Now that you have this information, you can make the mount command.

You can update an existing startupscript (nano /etc/rc5.d/S20samba , right before the "exit" line) so everytime deki starts up it automatically mounts the windows-share. Example:
Code:
echo mounting attachments drive
mount -t smbfs -o username=name,password=pass,workgroup=mydomain,rw,uid=33,gid=33 //server/share /var/www/deki-hayes/attachments
You should use the workgroup switch only if you are on a domain.

Finally, it is necessary to configure Deki to go one level deeper on its attachments share (since somehow it invokes commands to the root directory that are incompatible with the windows share).  Login as an admin onto your deki-wiki site, go to the control panel, click on "configuration" and edit the key "storage/fs/path".  This key defaults to "/var/www/deki-hayes/attachments" and you should only put it one level deeper like: "/var/www/deki-hayes/attachments/leveldeeper".

Some considerations:

With an initial install of the VM version of Deki, the "/var/www/deki-hayes/attachments" folder doesn't even exist . It gets made the first time you upload an attachment. So the mount command will not work if you do not upload an attachment first and delete it again. (delete it to get it out of the database, otherwise if you invoke the mount command later the attachment will be under the mounted folder and thus unavailable untill you unmount the windows share again. If you try to open the attachment you will get an error message.)

If you allready have a running deki installation and lots of attachments it might be best to first create another folder to put your attachments in ( eg /attachments) , chmod it 777 and mount the windows share on this folder. Now in this folder create the one level deeper folder and copy all attachments to it. If the copying is done point the configuration key "storage/fs/path" in your deki site to "/attachments/leveldeeper" and all should work.

 

 


Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08.2