Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

403 forbidden

Status
Not open for further replies.

mufka

ISP
Dec 18, 2000
587
US
I've setup Apache 1.3.20 on Redhat 7.1. I'm using name based virtual hosts. I can't get any web other than the default apache page to come up. In every case, i get a 403 forbidden error in the browser. In the log for each web I get "GET / HTTP/1.1" 403 210.

I've checked and double checked the permissions and httpd.conf against another working server. Ipchains and iptables are disabled.
 
Hi,

With a 403 sounds like a permissions problem . Did you 'chown' the content so that the 'apache' user can read it ?

# chown -R apache.apache /var/
In its simplest form you just need something like the following in /etc/httpd/conf/httpd.conf :

NameVirtualHost *

<VirtualHost *>
ServerName UseCanonicalName off
DocumentRoot /</VirtualHost>

<VirtualHost *>
ServerName UseCanonicalName off
DocumentRoot /</VirtualHost>


Reload the config with :

# killall -HUP httpd

then try (having first put some content there of course)

Hope this helps
 
This seems quite bizarre to me. My user and group in httpd.conf are nobody and web. In the past (and on other existing servers) I have always set the ownership on the files in the webs to user='user who will be managing the web' and group = 'web'. I set the user to nobody and it works. I think that will now cause problems for the users uploading the files, won't it?
 
Hi,

I was quoting from a default redhat apache - in the environment you describe it would be different. The point is that the user under which apache runs needs to be able to access the content . Out of the box a redhat built apache rpm has this in its httpd.conf :

[snip]

# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# . On SCO (ODT 3) use &quot;User nouser&quot; and &quot;Group nogroup&quot;.
# . On HPUX you may not be able to use shared memory as nobody, and the
# suggested workaround is to create a user use that user.
# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
# when the value of (unsigned)Group is above 60000;
# don't use Group nobody on these systems!
#
User apache
Group apache

[snip]


Obviously if your 'User' and 'Group' are different then the permissions would be similarly different too.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top