problems accessing mounted directories

problems accessing mounted directories

am 04.05.2005 20:33:03 von Bob Ramsey

Hi,

I am running RedHat EL AS 4.0, Apache 2.0.52, fully patched. I have a
Windows 2003 server with a share that contains documents for the
website. I mount the windows share using the following line in fstab:

//192.xxx.xxx.xxx/web_documents /var/www/html/documents cifs
fmask=3D755,dmask=3D755,user,auto,credentials=3D/root/.webpa sswd,uid=3D67=
,gid=3D67
0 0

The mount works correctly. On my system, 67 is the uid and gid for
apache. I can log into the box as an unprivileged user, cd into the
directory and read the files with no problem. If I open konq and type
in file:///var/www/html/documents/index.html, konq opens the file with
no problem. If I try http://localhost/documents/index.html, I get:

Forbidden

You don't have permission to access /documents on this server.

Additionally, a 403 Forbidden error was encountered while trying to use
an ErrorDocument to handle the request.


I read that Apache might have problems accessing mounted drives, but not
links to mounted drives, so I changed the mount point to
/var/www/documents and did an ln -s /var/www/documents
/var/www/html/documents, but I get exactly the same result.

Any ideas? In theory, this should be possible, but I can't figure out
what I've messed up.

Thanks,

Bob

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: problems accessing mounted directories

am 04.05.2005 21:55:36 von Joshua Slive

On 5/4/05, Ramsey, Robert L wrote:
> I am running RedHat EL AS 4.0, Apache 2.0.52, fully patched. I have a
> Windows 2003 server with a share that contains documents for the
> website. I mount the windows share using the following line in fstab:
>=20
> //192.xxx.xxx.xxx/web_documents /var/www/html/documents cifs
> fmask=3D755,dmask=3D755,user,auto,credentials=3D/root/.webpa sswd,uid=3D67=
,gid=3D67
> 0 0
>=20
> The mount works correctly. On my system, 67 is the uid and gid for
> apache. I can log into the box as an unprivileged user, cd into the
> directory and read the files with no problem. If I open konq and type
> in file:///var/www/html/documents/index.html, konq opens the file with
> no problem. If I try http://localhost/documents/index.html, I get:
>=20
> Forbidden
>=20
> You don't have permission to access /documents on this server.
>=20
> Additionally, a 403 Forbidden error was encountered while trying to use
> an ErrorDocument to handle the request.

What does the apache error log say?

>=20
> I read that Apache might have problems accessing mounted drives, but not
> links to mounted drives,=20

Where did you read that? It sounds like BS to me.

Joshua.

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

RE: problems accessing mounted directories

am 04.05.2005 22:11:38 von gary

We purchased a terastore drive nas solution (which unfortunately only
supported samba), mounted it to /var/www/html/terastore and it has been
working without any problem. We didn't do anything special to the
permissions though.

Trying using a basic mount first

smbmount //192.x.x.x/web_documents /var/www/documents -o username=3Dxxx

and see if that helps. Get it working as a normal mount before mounting
it with fstab. =20

Now to the dumb questions. Do you have an index.html in there or are
you expending an index? If you are expecting the index of files did you
enable indexing?
=20
>=20
> I read that Apache might have problems accessing mounted drives, but
not
> links to mounted drives, so I changed the mount point to
> /var/www/documents and did an ln -s /var/www/documents
> /var/www/html/documents, but I get exactly the same result.

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

RE: problems accessing mounted directories

am 04.05.2005 22:38:31 von Bob Ramsey

=20
>=20
> What does the apache error log say?

D'oh, forgot to post it.

From access_log:

192.xxx.xxx.100 - - [04/May/2005:15:25:16 -0500] "GET /documents
HTTP/1.1" 403 463 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.7) Gecko/20050414 Firefox/1.0.3"
192.xxx.xxx.100 - - [04/May/2005:15:25:16 -0500] "GET /favicon.ico
HTTP/1.1" 404 342 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.7) Gecko/20050414 Firefox/1.0.3"
192.xxx.xxx.100 - - [04/May/2005:15:25:16 -0500] "GET /favicon.ico
HTTP/1.1" 404 342 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.7) Gecko/20050414 Firefox/1.0.3"

From error_log when using a symbolic link:

[Wed May 04 15:25:16 2005] [error] [client 192.xxx.xxx.100] Symbolic
link not allowed: /var/www/html/documents [Wed May 04 15:25:16 2005]
[error] [client 192.xxx.xxx.100] File does not exist:
/var/www/html/favicon.ico [Wed May 04 15:25:16 2005] [error] [client
192.xxx.xxx.100] File does not exist: /var/www/html/favicon.ico

From error_log when using just the mounted directory:

[Wed May 04 12:57:10 2005] [error] [client 128.255.136.100]
(13)Permission denied: access to /documents denied


In theory I have turned on followsymlink. That is what is checked in
the RedHat Apache config tool. And checking httpd.conf shows
followsymlinks turnd on as far as I can tell.

> > I read that Apache might have problems accessing mounted=20
> drives, but=20
> > not links to mounted drives,
>=20
> Where did you read that? It sounds like BS to me.

I'll take your word on that. Here's what I was referencing:

http://forums.devarticles.com/t5261/s.html

Some solved a problem of not being able to access a mounted drive by
symlinking to it. That may have just put a bandaid on a completely
different problem though.

Thanks,

Bob

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

RE: problems accessing mounted directories

am 04.05.2005 22:49:02 von Bob Ramsey

> Trying using a basic mount first
>=20
> smbmount //192.x.x.x/web_documents /var/www/documents -o =
username=3Dxxx
>=20
> and see if that helps. Get it working as a normal mount=20
> before mounting it with fstab. =20

I did that. It actually took a little extra work to get them mounted.
The shares I'm mounting are on a Windows 2003 server and that needs to
be mounted as mount -t cifs instead of samba. But it's all working now.
If I go into a web browser on the dev server and use
file:///var/www/html/documents/index.html it works fine, but changing to
http://localhost/documents/index.html doesn't work. And a
non-privileged acount on the server can also browse to the index file
through a file manager.


>=20
> Now to the dumb questions. Do you have an index.html in=20
> there or are you expending an index?

I have an index.html.


Thanks,

Bob=20

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

RE: problems accessing mounted directories

am 04.05.2005 23:49:42 von gary

I'm confused. You should still be able to mount it as a samba drive.
We have a couple configurations already running like this. What extra
work did you have to do?

> I did that. It actually took a little extra work to get them mounted.
> The shares I'm mounting are on a Windows 2003 server and that needs to
> be mounted as mount -t cifs instead of samba. But it's all working
now.

As a test I just connected our intranet server to our users server
(which is 2003) and it worked just fine.

[root@pxtvjoint03 html]# mkdir test

[root@pxtvjoint03 html]# smbmount //pxtvjoutl01/users test -o
username=3Dmyname,workgroup=3Dmydomain
Password: well>

[root@pxtvjoint03 html]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda3 25197252 1778732 22138544 8% /
/dev/hda1 124427 13504 104499 12% /boot
none 127124 0 127124 0% /dev/shm
/dev/drbd0 1894928 49744 1748924 3% /exports
//pxtvjoutl01/users 204144640 62574592 141570048 31%
/exports/www/html/test

[root@pxtvjoint03 html]# ls -l test/Fire*
-rwxr-xr-x 1 root root 4816464 Mar 13 13:44 test/Firefox Setup
1.0.1.exe

[root@pxtvjoint03 html]# wget "http://localhost/test/Firefox Setup
1.0.1.exe"
--16:44:40-- http://localhost/test/Firefox%20Setup%201.0.1.exe
=3D> `Firefox Setup 1.0.1.exe'
Resolving localhost... 127.0.0.1
Connecting to localhost[127.0.0.1]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4,816,464 [application/octet-stream]

100%[=================== 3D=====
==================== =====3D=
===================3D
==================== ===3D>] =
4,816,464 5.86M/s =20

16:44:41 (5.85 MB/s) - `Firefox Setup 1.0.1.exe' saved
[4,816,464/4,816,464]

[root@pxtvjoint03 html]#

Hope this helps...

Gary

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: problems accessing mounted directories

am 05.05.2005 00:40:41 von Joshua Slive

On 5/4/05, Ramsey, Robert L wrote:

> > What does the apache error log say?

> [Wed May 04 12:57:10 2005] [error] [client 128.255.136.100]
> (13)Permission denied: access to /documents denied

Ditch the symlinks. They shouldn't be necessary.

The above error indicates a unix permissions problem. =20
Do you have SELinux running? If so, that is probably the problem.=20
Otherwise, try logging in as the same user specified in the httpd.conf
User/Group and see if you can access the files.

Joshua.

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

RE: problems accessing mounted directories

am 05.05.2005 01:30:07 von Bob Ramsey

Joshua Slive" ,



Aha! I'll bet that is it. I am indeed running SELinux. That would =
explain why I couldn't su apache at the command line to see if I could =
access the folder, but I could su as an non-privileged user. I'll have =
to check that when I get back to work tomorrow, but I'm sure you're =
right. You usually are. ;)

Thanks for all the help, I'll let you know if that's the problem.

Bob

-----Original Message-----
From: Joshua Slive [mailto:jslive@gmail.com]
Sent: Wed 5/4/2005 5:40 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] problems accessing mounted directories
=20
On 5/4/05, Ramsey, Robert L wrote:

> > What does the apache error log say?

> [Wed May 04 12:57:10 2005] [error] [client 128.255.136.100]
> (13)Permission denied: access to /documents denied

Ditch the symlinks. They shouldn't be necessary.

The above error indicates a unix permissions problem. =20
Do you have SELinux running? If so, that is probably the problem.=20
Otherwise, try logging in as the same user specified in the httpd.conf
User/Group and see if you can access the files.

Joshua.

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server =
Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org