Web Server Configuration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignWeb Server Configuration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 7th, 2003, 10:32 PM
Sandman71 Sandman71 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 5 Sandman71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Apache help

OK, this is driving me crazy, and hopefully someone will be able to help.

My DocumentRoot is /var/www/html
I've mounted a new disk to /var/www/html2

Using virtual hosts, I pointed a test subdomain to /var/www/html2, but no matter what I do I get a 403 Forbidden error.

/var/www/html2 is owned by user/group apache.

Here is my Virtual host entry:

<VirtualHost *>
ServerName www3.somedomain.org
DocumentRoot /var/www/html2/www3
ServerAdmin sandman@somedomain.org
ErrorLog logs/www3_error.log
CustomLog logs/www3_access.log common
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php .php
</VirtualHost>

My virtual hosts hosted in /var/www/html work flawlessly.

Is it possible to have more than one DocumentRoot, or have apache recognize more than one path?

Reply With Quote
  #2  
Old October 8th, 2003, 07:03 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Could it be the asterisk in the VirtualHost directive? Or, have you checked the rest of the conf file for a switch that turns virtual hosting on? Seems like there's something like that, though it's been a while since I've done any apache config. Maybe something like:

NameVirtualHost *

Or it could be that even though the drive is mounted and appears to be owned by the correct user, there's something funky going on with permissions. Try pointing the virtual host that currently works to that directory and see if you get the forbidden error. If so, it's probably a permissions error; if not, it's probably an apache conf error.

Reply With Quote
  #3  
Old October 8th, 2003, 07:16 AM
Sandman71 Sandman71 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 5 Sandman71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
That's not it

I'm running roughly 15 other Virtual hosts, all configured the same way, and they work (but they're all hosted on /var/www/html).

I did try to move an existing directory from /var/www/html to /var/www/html2 and still get the forbidden error. This is not a permissions issue however, or a problem with the mount. Even though my virtual host points to /var/www/html2, that path is not in the apache search path, hence why the forbidden error.

I did try to add a 2nd DocumentRoot /var/www/html2 to apache.conf but that made no difference.

Reply With Quote
  #4  
Old October 8th, 2003, 08:45 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
That you moved an existing directory to /var/www/html2 and got the same error would seem to indicate that there is a problem with the mount or with the permissions, wouldn't it? What kind of mount is it? This is probably a no-brainer, but just to cover bases, I'm assuming www3 on that mounted drive exists and is readable/executable, owned by apache, etc.? At any rate, it doesn't sound like you've got an apache config issue if you've got 15 other virtual hosts working. To my knowledge, adding a second DocumentRoot outside the virtual host won't do anything for you. Just for kicks, have you tried symlinking to the mounted disk? That probably won't help any.

Reply With Quote
  #5  
Old October 9th, 2003, 12:06 AM
Sandman71 Sandman71 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 5 Sandman71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Not a mount/permissions issue

OK, this is pointing more and more to Apache not scanning or allowing /var/www/html2.

I renamed the mount point and created a simlink and it works that way. It is very messy however

ln -s /mnt/otherhtml /var/www/html/html2

And changed my VirtualHost entry to point to /var/www/html/html2

So I know it's not a permissions problem or a mount issue as previously suggested.

Reply With Quote
  #6  
Old October 9th, 2003, 07:11 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 24 m 44 sec
Reputation Power: 7
Re: Not a mount/permissions issue

Quote:
Originally posted by Sandman71
OK, this is pointing more and more to Apache not scanning or allowing /var/www/html2.

I renamed the mount point and created a simlink and it works that way. It is very messy however

ln -s /mnt/otherhtml /var/www/html/html2

And changed my VirtualHost entry to point to /var/www/html/html2

So I know it's not a permissions problem or a mount issue as previously suggested.


it's a permission problem trust me, i found out the hard way and i had to manually edit thousands of files just to get it to work on my redhat machine
__________________
Apache Expert

Reply With Quote
  #7  
Old October 9th, 2003, 07:17 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Yeah, it does sound sort of like a permissions/mount issue to me. Trying to point to the mount itself, you get an error. Make a symlink on the local filesystem pointing to the mount and your problem's solved. Conclusion: You've got permission to read the local symlink; apache doesn't care that it's a symlink and just reads its contents like a regular old directory instead of treating it like a mounted drive. I'd wager at least a nickel that this is a permissions/mount issue and not an apache config issue.

Reply With Quote
  #8  
Old October 9th, 2003, 03:51 PM
Sandman71 Sandman71 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 5 Sandman71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
More more more

/var/www/html2 is owned by user/group apache, so the perms should be good.

I also did the following test: created a /bin directory on the /var/www/html2 mount. I tossed in a binary. Added /var/www/html2/bin in my path. I can then execute the binary without any problems (binary owned by apache/apache, and ran as user apache).

still confused....

Reply With Quote
  #9  
Old October 10th, 2003, 07:11 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
What kind of drive are you mounting? I found the following link, which may provide some insight:

http://www.mail-archive.com/sharity...t/msg00306.html

It points out that when mounting Windows drives, the permissions are mounted-user-based rather than Linux-permissions-based. So you can chmod all you want, but the permissions are based on who mounted the drive. So if you mounted the drive as root, then apache might not be able to access the drive. (And a Web/cron environment is different from a command line environment, so being able to execute a binary from the command line may not be the best test).

The reason I've thought all along it might be a mount/permissions issue is that my Linux desktop is mounted on some samba shares, and I can change permissions on those shares all I want from my side, but if I'm mounted as a user besides the user I am when trying to update files, I don't have permission on the files. Seems similar. I don't mean to flog that horse; it's all I can come up with, I'm afraid.

Reply With Quote
  #10  
Old October 10th, 2003, 08:23 AM
Sandman71 Sandman71 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 5 Sandman71 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Not a windows partition

The entire drive was formatted as an ext2 partition.

It's being mounted by fstab and mtab.

Reply With Quote
  #11  
Old October 10th, 2003, 09:16 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Geez. I've got nothing. Go with the symlink for now, I guess.

Reply With Quote
  #12  
Old October 22nd, 2003, 10:00 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Make sure that the folder,subfolder, etc, is all owned by the group/user that apache runs as, otherwise it WONT work

I had some problems with this previously myself, let me go home and I'll post what I had to do for mine later tonight...

Reply With Quote
  #13  
Old October 24th, 2003, 04:39 PM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 24 m 44 sec
Reputation Power: 7
Cool

ok change the user and group name to the main person who will be using the server. ex (Sandman71,Sandman71) now be sure to be logged in as sandman71 for this to work. open up the terminal screen and type this in...


chmod -R 0755 and it shall gives that particular user rights to read and write to that directory

hopefully dhouston or someone else can explain this better

Reply With Quote
  #14  
Old April 10th, 2005, 02:01 PM
SlimJim SlimJim is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Location: Derby, England
Posts: 1 SlimJim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 59 sec
Reputation Power: 0
Quote:
Originally Posted by dhouston
Geez. I've got nothing. Go with the symlink for now, I guess.


Well it's 18 months later and I'm sure your problem's gone away by now, but for the benefit of anyone who, like me, had the same problem and found this thread while googling for possible solutions, here's what I did to fix it.

I found this <Directory> block in commonhttpd.conf, an Include file called by httpd2.conf:

Code:
 <Directory /var/www/html>
 
 #
 # This may also be "None", "All", or any combination of "Indexes",
 # "Includes", "FollowSymLinks", "SymLinksifOwnerMatch", "ExecCGI", or "MultiViews".
 #
 # Note that "MultiViews" must be named *explicitly* --- "Options All"
 # doesn't give it to you.
 #
 	Options -Indexes FollowSymLinks MultiViews
 
 #
 # This controls which options the .htaccess files in directories can
 # override. Can also be "All", or any combination of "Options", "FileInfo", 
 # "AuthConfig", and "Limit"
 #
 	AllowOverride All
 
 #
 # Controls who can get stuff from this server.
 #
 	<IfModule mod_access.c>
 	  Order allow,deny
 	  Allow from all
 	</IfModule>
 </Directory>


Now, I'd set up a document root for a second virtual host, /var/www/groover, so clearly it wasn't covered by this section of config - as indeed your own /var/www/html2 wouldn't be.

Duplicating the above code in the config file, for /var/www/groover made the 403 error go away for the virtual host. Clearly, by default, Apache is designed to withhold content from document roots that aren't explicitly permitted by the section of code.

Regards
James

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Server Configuration > Apache help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |