Solved

smbfs on Ubuntu issue

Posted on 2014-03-13
9
331 Views
Last Modified: 2014-03-14
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.
0
Comment
Question by:Brocklv6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 39928847
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
 

Author Comment

by:Brocklv6
ID: 39929580
//nv-nas01/shared on /mnt/SambaProjects type cifs (rw,mand)
2014-03-14-8-39-18.png
0
 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 39929614
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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 

Author Comment

by:Brocklv6
ID: 39929657
@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
 
LVL 62

Expert Comment

by:gheist
ID: 39929677
it should be what your webserver group is, so that it can read files.
0
 

Author Closing Comment

by:Brocklv6
ID: 39930183
I changed the following and it works correctly now:
uid=www-data gid=www-data

Thank you gheist for your help!
0
 
LVL 62

Expert Comment

by:gheist
ID: 39930601
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
 

Author Comment

by:Brocklv6
ID: 39930608
I do understand. However this server does not touch the internet at all nor can client machines access anything other port 80.
0
 
LVL 62

Expert Comment

by:gheist
ID: 39930703
Does anything on the website need to write anything ever in content directories?
I'd say no unless proven otherwise.
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question