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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

403: Forbidden error

Status
Not open for further replies.

pctechnician

Technical User
Feb 10, 2003
134
0
0
US
I am trying to configure my apache server. when i tried to access the localhost page i received a Forbidden message saying that I dont have permission to access / on this server.

I dont understand what is going on. I am even running as root user.

Any one know whats going on ?

Any help would be appreciated

A+,Net+
 
do you have an index.html file in the document root?
 
Yes i do have an index.html file in the document root, i have to same thing in the directive also.

It doesn't refer to the index.html file that i created though.

i created index.html in my /home/webmastr/pub/html directory

but everytime i go to my localhost it refers to the congradulation screen that comes up when you first install apache.

I think i fixed the 403 problem, i just changed ownership of the webmastr /home dir to root and i didnt get any 403 errors.

A+,Net+
 
The apache server by default runs as 'nobody'. I good start for troubleshooting is to look in the error_log file which usually gives you an indication of what the problem is.

~Mike
 
should I run Apache under a different user/group?

A+,Net+
 
Not necessarily. 'nobody' only has access to world readable objects, or objects owned by 'nobody'.

What error do you get - what does the error_log say?
 
Some distros have user and group as apache. Which ever you use, make sure there is a user and group by that name on your system.
 
The error_log said:

[crit](98)address in use: make_sock: could not bind to port 80

I also looked inside the access_log and it said:

"get /apache_pb.gif http/1.0" 304

i know the /apache_pb.gif is the file insida htdocs, but i don't understand why its being requested when i specified in the document root and the directive that another file in a directory be shown.

A+,Net+
 
The first error indicates that the server is already running on port 80 or som other servie on that port).

The second message cuold indicate that the DoumentRoot is not set to what you want it to be, or think it is... Check the DocumentRoot directive, and also if there are any <Directory ...> or Alias'es pointing somewhere else...


 
Hi,I've just intalled Apache 2.0.46 on my redhat 9 ...
When I test it with it works fine. But when I change the DocumentRoot from &quot;/usr/local/apache2/htdocs&quot; to &quot;/home/myuser/web&quot;, It return me the forbidden error.

Permisions are same on two directories:
drwxr-xr-x 5 root root 4096 Jul 27 17:42 /usr/local/apache2/htdocs/
drwxrwxr-x 4 i5513 i5513 4096 Jul 27 15:21 /home/i5513/proyecto/ord_reglas/web/

I tried to change directory owner from root to i5513, and it work too.

This is a typical error on my log file:
[Sun Jul 27 17:27:32 2003] [notice] SIGHUP received. Attempting to restart
[Sun Jul 27 17:27:32 2003] [notice] Apache/2.0.47 (Unix) configured -- resuming normal operations
[Sun Jul 27 17:27:35 2003] [error] [client 127.0.0.1] (13)Permission denied: access to / denied
[Sun Jul 27 17:27:35 2003] [error] [client 127.0.0.1] (13)Permission denied: access to /favicon.ico denied, referer:
Any idea?
Thanks you!
 
Are you trying to give a web page to all of your users? If so, you would use the UserDir directive as follows:

UserDir public_html

<Directory /home/*/public_html>

AllowOverride all
Options all
Order allow, deny
Allow from all

</Directory>

You can change &quot;public_html&quot; to whatever you want and you can setup the directory container with almost any directives you use in the main. To access their webpage, the url would be What you are doing here is giving your users webspace they already have permissions for and you are tell apache that these directories are ok to serve. I hope I understood what you are trying to do or I'll feel like a fool. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top