tags:

views:

1234

answers:

2

trying to mount an smb share on OS X so that the 'www' user can read files from there.

the SMB share is accessible via an Active Directory account. I can mount the share through the Finder (cmd-k ...)

my basic approach is

# 1) create mountpoint 
sudo mkdir /Volumes/www_mdisk

# 2) permissions for mountpoint
sudo chown www:www /Volumes/www_mdisk; sudo chmod 777 /Volumes/www_mdisk

# 3) make a link from apache docroot to mountpoint (http.conf FollowSymlinks is on)
cd /Library/WebServer/Documents; ln -s /Volumes/www_mdisk mdisk

# 4) mount the SMB share using the Active Directory user 'ad_user'
sudo mount_smbfs -O www/www '//DOMAIN;ad_user@smbshare_host/sharepath'

step 4 fails though. I have read the manpages, tried many different combinations (with or without -O switch), but can't get it to work

can you help me get it right? thanks!

+1  A: 

ok, I can do this now on Mac OS X 10.4

# 4) mount the SMB share using the Active Directory user 'ad_user'
sudo mount_smbfs -O www/www -u 70 -g 70 '//DOMAIN;ad_user@smbshare_host/sharepath' www_mdisk

# 5) make sure http.conf has 'Options Indexes' enabled for Docroot
duh.

So everything works now on 10.4, following the steps above.

problem is, step 4) doesn't work on Mac OS X 10.5. mount_smbfs has lost the '-O' option...

Anybody knows how to do this on 10.5?

captnswing
A: 

Sorry this answer is two years late, but I had a similar problem and was able to solve it using your steps, more or less. I followed steps 1-3, and then for step 4, I sudo'd as _www instead of using the -O option (since it doesn't exist any longer.)

sudo -u _www mount_smbfs //User:Password@Host/Share /mount/point

I'm running 10.6 Snow Leopard and the Apache user seems to be _www. Anyway, after beating my head against this problem for some time (since chown and chmod don't seem to work on mounted Samba shares), this finally worked. Thanks!

Mitch Lindgren