smbfs on Ubuntu issue

We have a simple web app that was written to basically automate a folder structure on a Windows file server. The application will authenticate A.D. users then prompt them to enter a project name (folder name). The script then  makes a copy of a "template" folder structure on the file server and renames it to the project name. Within the last couple days, nothing has changed in the script or the Apache server, the application will authenticate users and can create the root folder (project folder) but errors when trying to create the sub-folders. The error is a permissions error.

The Apache server mounts a share on the Windows server with smbfs.

On the windows file server the permissions are set to everyone and domain users {read/write} recursively from the share root down.

On the Apache server the permissions are set to {777} recursively from /mnt down.

This Apache server and Windows file server are LAN facing only, no firewalls to deal with.

Any input would be greatly appreciated.
Brocklv6Asked:
Who is Participating?
 
gheistConnect With a Mentor Commented:
mount -o remount,uid=root,gid=apache,mode=0750  /mnt/SambaProjects

that should do the trick right away, then enter respective parameters into /etc/fstab
0
 
gheistCommented:
you can specify permissions on mount command line and fstab

1.1.1.1:/c$/mnt smbfs default,mode=0750,uid=root,gid=httpd
0
 
Brocklv6Author Commented:
//nv-nas01/shared on /mnt/SambaProjects type cifs (rw,mand)
2014-03-14-8-39-18.png
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Brocklv6Author Commented:
@gheist,

when I run:
mount -o remount,uid=root,gid=apache,mode=0750  /mnt/SambaProjects

I get an error of:
bad group name "apache"
0
 
gheistCommented:
it should be what your webserver group is, so that it can read files.
0
 
Brocklv6Author Commented:
I changed the following and it works correctly now:
uid=www-data gid=www-data

Thank you gheist for your help!
0
 
gheistCommented:
Just .01c on security:

No you should not let apache change it's content AT ALL (heard of defacements or sites spreading viruses?)
UID=anything but www-data
0
 
Brocklv6Author Commented:
I do understand. However this server does not touch the internet at all nor can client machines access anything other port 80.
0
 
gheistCommented:
Does anything on the website need to write anything ever in content directories?
I'd say no unless proven otherwise.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.