Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I mount a windows shared folder (windows allow write access) into my Ubuntu system, so that apache2 will be able to write there. Point is, I'm synchronizing folder files from my Windows PC, and Ubuntu machine acts only like the server, so problem is files created in shared folder at my Windows are not writable by apache (it can't open log files and other misc stuff)

Thanks!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Solution I've found:

Find out the GID of the apache2, group default name is www-data, GID can and other user/group can be found at /System/Administration/Users and Groups

Mount a folder using smbfs and pass the *dir_mode* and *file_mode* parameters together with the GID.

Best to store a command at your /etc/fstab file, here is mine:

//192.168.72.2/Websites /home/brock/Windows smbfs iocharset=utf8,file_mode=0777,dir_mode=0777,gid=33 0 0

Extra info can be found here

share|improve this answer
    
this is pretty much the right way to do it. the other option is to configure your Apache to run as another user that does have write access to the mount... but that is a bit more complicated and possibly less secure. –  quack quixote Nov 21 '09 at 14:55

Mount the Windows Share as a Samba Share. See http://en.wikipedia.org/wiki/Smbmount

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.