View previous topic :: View next topic |
Author |
Message |
igor92128 Apprentice
Joined: 27 Jun 2004 Posts: 156 Location: California
|
Posted: Thu Feb 10, 2005 10:45 pm Post subject: Apache 403 error |
|
|
I have configured Apache and everything works fine. When I first installed it, I got the Apache default page. Then I changed the DocumentRoot to the directory that I want to use, but after that I get 403 errors when trying to access it. If I change the DocumentRoot back to the default directory it works. I've even copied my page to /var/www/localhost and messed around with the permissions, but I still get 403 error and I can't access the page.
Code: |
/var/www/localhost/htdocs <= default page
/var/www/localhost/mypage <=my page
|
I've changed the permissions for the mypage directory but that doesn't help.
What could be the problem?
Thanks,
Igor |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Thu Feb 10, 2005 11:23 pm Post subject: |
|
|
Look at your access_log. Search for the file (or directory) name on which you get the 403. The log line will tell you whether access is prohibited by configuration directives (Allow / Deny from lines) or by file system access permissions. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
igor92128 Apprentice
Joined: 27 Jun 2004 Posts: 156 Location: California
|
Posted: Thu Feb 10, 2005 11:31 pm Post subject: |
|
|
Ok, I did that but I don't think it's telling me much. Here's a line from access_log:
Code: |
144.37.183.79 - - [10/Feb/2005:15:25:23 +0000] "GET / HTTP/1.1" 403 289 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR$
|
What do you think?
Igor |
|
Back to top |
|
|
igor92128 Apprentice
Joined: 27 Jun 2004 Posts: 156 Location: California
|
Posted: Thu Feb 10, 2005 11:34 pm Post subject: |
|
|
Maybe its error_log that you wanted me to post?
Code: |
[Thu Feb 10 13:24:17 2005] [error] [client 144.37.183.78] client denied by server configuration: /var/www/localhost/mysite/
|
Heres a line from that. So it looks like something's wrong with my server configuration.
thanks,
Igor |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Fri Feb 11, 2005 1:14 am Post subject: |
|
|
Oops, error_log of course. Sorry about that.
The most common cause for this error is placing stuff in /var/www/localhost instead of /var/www/localhost/htdocs and forgetting that by default Gentoo's access configuration via the Directory directive only cover stuff under htdocs, not peers of htdocs. So either move the mysite under htdocs (where it would actually make sense), or add a Directory directive covering /var/www/localhost/mysite (look at the /var/www/localhost/htdocs one for an example). _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
igor92128 Apprentice
Joined: 27 Jun 2004 Posts: 156 Location: California
|
Posted: Fri Feb 11, 2005 1:26 am Post subject: |
|
|
So, what is exactly the Directory directive? /var/www/localhost/htdocs only contains a bunch of index files in different languages. Is this directive supposed to be some kind of config file?
Also, can I add the site under an htdocs subfolder or does it have to be under the root? So would this work: /var/www/localhost/htdocs/mysite ?
Igor |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Fri Feb 11, 2005 1:41 am Post subject: |
|
|
igor92128 wrote: | So, what is exactly the Directory directive? /var/www/localhost/htdocs only contains a bunch of index files in different languages. Is this directive supposed to be some kind of config file?
Also, can I add the site under an htdocs subfolder or does it have to be under the root? So would this work: /var/www/localhost/htdocs/mysite ?
Igor |
In Apache's configuration files under /etc/apache2 - specifically in commonapache2.conf. I assumed you knew what I was talking about. If you're not sure about that, I highly recommend you don't touch the configuration. All you need to do for your site to work is place whatever you need in subdirectories under /var/www/localhost/htdocs, and everything will work just fine. In your case, /var/www/localhost/htdocs/mysite would map to the URL http://your.domain.or.ip.address/mysite - which is what I assume you want.
So in short, move that mysite directory under htdocs. For your web development / HTTP stuff, only create subdirectories in there and only work in them. They'll be accessible automagically as /dirname just like mysite above.
For more info on how to configure Apache see the Apache server documentation either by going to http://httpd.apache.org or by emerging the apache-manual package, restarting Apache, and going to http://your.domain.or.ip.address/manual
Also, don't forget about the Documentation, Tips & Tricks forum, and make heavy use of the forum's search function. It's there for a reason. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
igor92128 Apprentice
Joined: 27 Jun 2004 Posts: 156 Location: California
|
Posted: Fri Feb 11, 2005 6:10 am Post subject: |
|
|
Ok now I realize what you were talking about. In Windows I think commonapache2.conf is called httpd.conf and I always modified the directory directive. I got it working fine now.
Thanks,
Igor |
|
Back to top |
|
|
moocha Watchman
Joined: 21 Oct 2003 Posts: 5722
|
Posted: Fri Feb 11, 2005 6:45 am Post subject: |
|
|
The configuration file can be called anything - httpd.conf is just a default name.
Under Gentoo the configuration is split among a few files: apache2.conf (which one shouldn't modify), commonapache2.conf (where global directives go), the Apache extra modules configurations, and the virtual host configurations. They all get included directly or indirectly by apache2.conf. You'll find all of them under /etc/apache2/conf. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
Back to top |
|
|
|