LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-21-2008, 07:09 AM   #1
dipuasks
Member
 
Registered: Oct 2005
Location: India
Distribution: Redhat 7-9,Fedora Core 3 - 9, RHEL 4 -5, CentOS 4 - 5, Ubuntu 7.10 - 12.10, Mandirva 2008 -2009
Posts: 133

Rep: Reputation: 16
Question DocumentRoot on samba share?


I have installed and configured Apache 2.2.9 with php 5.2.6, everything working fine. But my requirement is to have an existing windows share use as DocumentRoot.

I mount the share with this command:

mount -t cifs //server/share /abc/wwwroot -o rw,domain=xxx,username=xxxx,password=xxxx,uid=apache2,gid=www

Mount is successful but when I change my documentroot in httpd.conf to the mounted folder (/abc/wwwroot), only I can see a blank page in the browser when I try to access any page.

I see the file and directory permissions of the wwwroot folder change after mounting the share and perhaps that's is causing the problem.

Any ideas for getting the above done?

Thanks in advance.

--Dipu
-----------
You know, windows didn't get that bad over night! It took fifteen years of careful development!
 
Old 08-21-2008, 09:19 AM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by dipuasks View Post
Any ideas for getting the above done?
You might have to create an "apache" account on the Windows machine and use those credentials to mount the share. Do not forget to give the apache account access to the files in the directory you want to share.
 
Old 08-21-2008, 09:46 AM   #3
dipuasks
Member
 
Registered: Oct 2005
Location: India
Distribution: Redhat 7-9,Fedora Core 3 - 9, RHEL 4 -5, CentOS 4 - 5, Ubuntu 7.10 - 12.10, Mandirva 2008 -2009
Posts: 133

Original Poster
Rep: Reputation: 16
Ok, I created a account apache2 in AD server. As the share is accessible to "everyone", I don't have to give any specific permission. Even I mounted the share after authenticating with apache2 account. But still no luck. This was the exact command I issued:

mount -t cifs //neuron/webdev test/ -o domain=emx,username=apache2,rw,uid=apache2,gid=www,password=xxxxx

After mount, I did ls and the permissions are like the below for all dir, subdir and files. I get permission denied error when I try to change permissions. I think the sticky bit and permissions are causing problem.

drwxrwxrwx 1 apache2 www 0 Jul 10 00:46 style_sheet
drwxrwxrwx 1 apache2 www 0 Jul 10 00:46 Templates
-rwxrwSrwt 1 apache2 www 10346 Nov 3 2007 test1.php
-rwxrwSrwt 1 apache2 www 4383 Jul 3 11:01 test.php

I think either apache doesn't allow docroot to be on a remote share or something need to be done in order to have permissions as we need.

Please suggest.

--Dipu
-----------
You know, windows didn't get that bad over night! It took fifteen years of careful development!
 
Old 08-21-2008, 04:57 PM   #4
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by dipuasks View Post
Ok, I created a account apache2 in AD server. As the share is accessible to "everyone", I don't have to give any specific permission.
Did you make sure to give "everyone" full access? Can you "cat" the .php files?
 
Old 08-21-2008, 10:27 PM   #5
dipuasks
Member
 
Registered: Oct 2005
Location: India
Distribution: Redhat 7-9,Fedora Core 3 - 9, RHEL 4 -5, CentOS 4 - 5, Ubuntu 7.10 - 12.10, Mandirva 2008 -2009
Posts: 133

Original Poster
Rep: Reputation: 16
Yes "everyone" user has full access, and I can cat files.

--Dipu
-----------
You know, windows didn't get that bad over night! It took fifteen years of careful development!
 
Old 08-22-2008, 09:14 AM   #6
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by dipuasks View Post
Yes "everyone" user has full access, and I can cat files.
Can you cat the files if you run "su apache" first?
 
Old 08-22-2008, 10:11 AM   #7
dipuasks
Member
 
Registered: Oct 2005
Location: India
Distribution: Redhat 7-9,Fedora Core 3 - 9, RHEL 4 -5, CentOS 4 - 5, Ubuntu 7.10 - 12.10, Mandirva 2008 -2009
Posts: 133

Original Poster
Rep: Reputation: 16
Hi, Thanks for reply.


Of course I can because I am specifying uid & gid of user "apache" while mounting. When I do "ls", I see the all the files highlighted yellow which make them look foreign files.

The -rwxrwSrwt & drwxrwxrwx permission looks the real culprit to me. How to get rid of that sticky bit from every file and how to set desired permission?




--Dipu
-----------
You know, windows didn't get that bad over night! It took fifteen years of careful development!
 
Old 08-22-2008, 10:35 AM   #8
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by dipuasks View Post
Of course I can because I am specifying uid & gid of user "apache" while mounting. When I do "ls", I see the all the files highlighted yellow which make them look foreign files.
I would like to believe you, but I would also like you to try "su apache" and then cat the files.

Quote:
Originally Posted by dipuasks View Post
The -rwxrwSrwt & drwxrwxrwx permission looks the real culprit to me. How to get rid of that sticky bit from every file and how to set desired permission?
I played around with cifs here and had some problems. Then I found this post:
http://www.linuxquestions.org/questi...68#post2682368
For some reason, cifs does not like hostnames.

I have the sticky bit set on my files, but I am able to cat them as root. I also used su to switch to a less privileged user, and I could still cat the files. The only thing I have not tried is to use Apache with the mounted directory.

Last edited by David1357; 08-22-2008 at 10:39 AM. Reason: Added more info about using cifs
 
Old 08-22-2008, 12:56 PM   #9
dipuasks
Member
 
Registered: Oct 2005
Location: India
Distribution: Redhat 7-9,Fedora Core 3 - 9, RHEL 4 -5, CentOS 4 - 5, Ubuntu 7.10 - 12.10, Mandirva 2008 -2009
Posts: 133

Original Poster
Rep: Reputation: 16
Thumbs up

Quote:
I would like to believe you, but I would also like you to try "su apache" and then cat the files.
Yes David, I had tried that before I posted my reply and I was able to cat.

The hostname/IP address thing looks interesting, will surly give a try and let you know.

Thanks!


--Dipu
-----------
You know, windows didn't get that bad over night! It took fifteen years of careful development!
 
  


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
mount windows share export to samba share -> improve network performance tuning newuser77 Linux - Server 1 07-23-2008 11:28 AM
show the samba share but can't mount the share badall Linux - Server 3 05-30-2007 04:24 AM
searching samba share breaks connection to share Elomis Linux - Server 1 05-11-2007 12:28 AM
Simple Samba Setup, Share & Not Share timmywo Linux - Software 4 07-30-2004 07:27 AM
DocumentRoot on a nfs mounted share pdhami Red Hat 0 05-17-2004 02:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:19 AM.

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
Open Source Consulting | Domain Registration