LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-13-2009, 07:23 PM   #1
guapo42
LQ Newbie
 
Registered: Nov 2009
Posts: 6

Rep: Reputation: 0
Apache 403 Forbidden error when accessing cifs mount


Before we get started,this is all behind a firewall. I'd never want to set this up on a live server. I'm just setting up a web development box so I can save on my windows desktop and see the site update on my centos5.3 server.


Here's the problem.

When I view normal files (through a browser) in my web root :
/var/www/html/
everything is fine.

When I try to view the same files mounted on my windows share.
mount -t cifs -o uid=48,gid=48,username=domain\\user.name,password=xxxxxxx //domain/web /var/www/html/share

I get a 403 Forbidden error, and the incredibly useful log entry:
[Fri Nov 13 11:34:19 2009] [error] [client 10.0.x.x] (13)Permission denied: access to /share/test.html denied


Here's the permission of the file:
drwxrwxrwx 1 apache apache 4096 Nov 13 2009 .
drwxrwxr-x 12 guapo webdev 4096 Nov 13 11:06 ..
-rwxrwSrwx 1 apache apache 5 Nov 13 2009 test.html

I'm guessing the S is my problem? But for the life of me I don't know how it got there or how to get rid it of.
chmod g-s test.html didn't work, neither did taking out the suid in the options, nor did noperm, not even chmod u-s /bin/mount.

So I'm awfully stuck here and would love some help, because i'm out of things to try.

The other weird thing about all this is that the command above works well and I can access/read/write to the share files just fine. But when I try to use automount I can't mount it in the /var/www directory. The exact same config works in /mnt/ but not in var/www. I don't know if this is related, and I can get around it with ln -s but who knows, it might be useful clue.

Thanks so much in advance,
guapo
 
Old 11-15-2009, 07:28 PM   #2
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
Permissions

Checklist:
  • Did you set the allow from all directive on the directory?
  • Did you set the directory index properly?
  • Do you have a directory index file?
  • Does it work if you unmount the share and place the files locally?

Now a word of warning. Using this setup you WILL suffer. Apache locks onto some files and Windows won't let you remove them while opened. This will for example unrecoverably mess up your SVN working copy if you attempt a branch switch. (You are using version control, right?)

If you must use Windows, I recommend using some sort of build and deployment mechanism. Apache Ant for example is a most useful tool.
 
Old 11-16-2009, 03:02 PM   #3
guapo42
LQ Newbie
 
Registered: Nov 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by janoszen View Post
Checklist:
  • Did you set the allow from all directive on the directory?
  • <Directory "/var/www/web">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>

    The directory I'm trying to access is /var/www/web/guapo/
    which should be accounted for by the above settings.

    Quote:
    Originally Posted by janoszen View Post
  • Did you set the directory index properly?
  • DirectoryIndex index.html index.html.var

    Quote:
    Originally Posted by janoszen View Post
  • Do you have a directory index file?
  • -rwxrwSrwx 1 apache apache 7 Nov 13 18:33 index.html
    still get 403 Forbidden when I try
    Quote:
    Originally Posted by janoszen View Post
  • Does it work if you unmount the share and place the files locally?
Well this is interesting,
if I copy a file from the mount to a directory outside the mount I still can't view it. If I create a new file with the exact same permissions, I can view it fine:
-rw-rw-r-- 1 guapo webdev 14 Nov 16 07:55 index2.html
-rw-rw-r-- 1 guapo webdev 7 Nov 13 18:33 index.html

So this is in /var/www/web/test/ and my mount is now at /var/www/web/guapo/ . I can view index2 created on the machine, I can't view index copied over from the mounted share.

If I unmount the directory and scp over the same file it works like a champ.


Quote:
Originally Posted by janoszen View Post
Now a word of warning. Using this setup you WILL suffer. Apache locks onto some files and Windows won't let you remove them while opened. This will for example unrecoverably mess up your SVN working copy if you attempt a branch switch. (You are using version control, right?)

If you must use Windows, I recommend using some sort of build and deployment mechanism. Apache Ant for example is a most useful tool.
Since this is only for personal development I don't mind too much a little pain switching branches. I can turn apache off if/when I need to.

But you bring up a good point this may not be the correct way to go about this. I'm using perforce (not a choice) and I have a working copy syncing to /var/www/web/ . The plan was to have a development copy that I can share with coworkers when I submit my changes each evening, and a working copy that will update everytime I hit ctrl-S. The workflow needs to be scalable so once I set someone up they need to be able to develop without ever sshing into the server.

I'm coming from a mac environment where I could just use vmware to have a working vm of centos running with shared folders. But the new job requires windows and a public hyper-v box for development. Any ideas on how I can hit ctrl-s in the editor and f5 in the browser and see the latest pushed pixel with this setup?

Would ant help me here or, or does it have to be sumbit to perforce server then sync with the dev server each time I want to refresh my changes?
 
Old 11-16-2009, 04:06 PM   #4
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
Can't tell

I can't tell about the Samba problem, but that's always a source of problems. If I were you, I'd either use a native environment or use Ant to copy files from your working environment to the Linux system. Ant has the benefit of being extremely configurable and you are able to run it right from Eclipse if you like, just before for example the PHP debugger kicks in.
 
  


Reply


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 403 forbidden error only for phpmyadmin elthox Linux - Newbie 4 05-05-2008 05:16 AM
Forbidden 403 error with my apache entz Linux - Software 2 12-17-2007 06:33 PM
Apache: 403 Forbidden Error daemonkl Linux - Newbie 4 10-14-2007 01:15 PM
apache error, 403 forbidden afrodocter Linux - Software 6 08-09-2004 09:35 PM
apache 403 error forbidden? bulliver Linux - General 4 01-31-2003 08:47 AM


All times are GMT -5. The time now is 12:07 PM.

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