Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 04-11-2009, 04:30 PM   #1
LQ Newbie
Registered: Apr 2009
Posts: 2

Rep: Reputation: 0
Apache access to mounted folder

Is it possible for Apache (running on Fedora 10) to serve files from a mounted samba folder?

My DocumentRoot of httpd.conf is set to the default /var/www/html, and then I create a mounted folder:

mkdir /var/www/html/mysite
mount -t cifs // -o username=Admin /var/www/html/mysite

If I then try to navigate to anywhere within localhost/mysite in a browser I get "you do not have permission to access...".

Is there any way to set permissions to allow this?

I have also tried setting DocumentRoot to the mounted folder itself, but this does not even allow me to start Apache ("DocumentRoot must be a directory" error).

I have selinux turned off.

Thanks for any help.
Old 04-11-2009, 05:18 PM   #2
Registered: Dec 2003
Location: ~root
Distribution: Debian
Posts: 363

Rep: Reputation: 33
You can either:
  1. Add a uid/gid option. Assuming UID and GID are user/group IDs of Apache user:
    mount -t cifs // -o username=Admin,uid=UID,gid=GID /var/www/html/mysite
  2. Use umask, so that everyone can access them:
    mount -t cifs // -o username=Admin,umask=000 /var/www/html/mysite

Last edited by saman007uk; 04-11-2009 at 05:19 PM.
Old 04-13-2009, 12:53 PM   #3
LQ Newbie
Registered: Apr 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks very much. I tried adding the unmask=000 and it worked great.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache root folder access j.gonsalves Linux - Newbie 1 03-22-2009 06:02 AM
Add folder access to Apache conf quilop Linux - Server 6 02-24-2007 07:49 AM
Apache can not run when I use for Documentroot folder in which mounted a partition rustam Linux - General 1 12-09-2005 05:48 AM
Forbidden error with Apache when accessing mounted folder. maneeshsethi Linux - Newbie 2 12-22-2004 12:48 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:07 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration