LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 01-06-2007, 08:09 AM   #1
vous
Member
 
Registered: Mar 2003
Location: Macondo
Distribution: Mandrake 9.1, 10.1, SuSE 8.1 pro, 10.1, Red Hat 8.0/9.0
Posts: 380

Rep: Reputation: 30
Apache2: Access forbidden! Error 403


Hello All,

I've just installed apache2 for the first time (after years of using Apache "1") and after a clean install, I type in:

http://localhost/

and get this:

>>>>>>>>>>>>>>
Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
localhost
Sat Jan 6 14:57:13 2007
Apache/2.2.0 (Linux/SUSE)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

The directories are not read protected, and I just made an index.html file, but still no luck?!?!

I keep on seeing this in the error logs:
>>>>>>>>>
[Sat Jan 06 15:31:44 2007] [error] [client 127.0.0.1] client denied by server configuration: /srv/www/htdocs/
<<<<<<<<<

So I checked the Doc Root:
default-server.confocumentRoot "/srv/www/htdocs"



I've changed the httpd-userdir.conf file and added this:

UserDir /srv/www/htdocs

<Directory /srv/www/htdocs>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

But still no luck! (Yes, I did check if the "LoadModule userdir_module /usr/lib64/apache2-prefork/mod_userdir.so" was being executed...)


What am I missing? Are there extra config steps I need to follow in order to get this Apache2 config going?

Last edited by vous; 01-06-2007 at 09:08 AM.
 
Old 01-06-2007, 09:27 AM   #2
vous
Member
 
Registered: Mar 2003
Location: Macondo
Distribution: Mandrake 9.1, 10.1, SuSE 8.1 pro, 10.1, Red Hat 8.0/9.0
Posts: 380

Original Poster
Rep: Reputation: 30
Ha!!

I found the "solution":

>>>>>
<Directory />
Options None
AllowOverride None
Order deny,allow
# Deny from all
</Directory>

<<<<<

BUT I wonder if this not going to expose any other vulnerabilities?

Does anybody know if this is the best way of doing this?
 
Old 01-31-2007, 06:22 PM   #3
ForYouAndI.com
Member
 
Registered: Jan 2006
Distribution: Debian
Posts: 82

Rep: Reputation: 15
I have had the same problem so many times now and couldn't figure out what was wrong! I am using Suse 10.2.
I fixed it in a much more secure way like this:

# forbid access to the entire filesystem by default
<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>
# public_html dir
<Directory /srv/www/htdocs>
Options None
AllowOverride None
Order deny,allow
Allow from all
</Directory>

Is this just a Suse problem? Why should we have to manually edit config files when YaST is supposed to do this for us?
 
Old 10-11-2011, 03:09 AM   #4
magmazia
LQ Newbie
 
Registered: Oct 2011
Posts: 1

Rep: Reputation: Disabled
Unhappy You don't have permission to access the requested directory. There is either no index document or th

Hi everybody, i changed my httpd.conf. but i have problem yet!! this is my httpd.conf file:
<Directory />
Options None
AllowOverride None
Order deny,allow
allow from all
</Directory>
# public_html dir
<Directory /srv/www/htdocs/>
Options None
AllowOverride None
Order deny,allow
allow from all
</Directory>
in addition i use opensuse
 
Old 10-11-2011, 04:46 AM   #5
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
If you have SELINUX security enabled then try disabling it and see if that makes any difference.
 
  


Reply



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
Apache2 virtual host cgi 403 Forbidden / mossy Linux - Software 15 07-27-2005 04:56 PM
access 403 forbidden - user_dir sigurdne Linux - Newbie 6 11-27-2004 05:55 AM
Error 403 Forbidden access in Apache anoop_cn Linux - Software 1 09-21-2004 09:32 AM
access 403 forbidden - questions from a newbie vr6stress Linux - Newbie 1 05-21-2004 07:31 AM
Apache - 403 Forbidden - Access to Subdirectories dieter Linux - Networking 2 03-25-2004 12:51 PM

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

All times are GMT -5. The time now is 06:08 PM.

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