LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-20-2005, 11:32 PM   #1
freedo5
LQ Newbie
 
Registered: Nov 2003
Posts: 4

Rep: Reputation: 0
Apache 403 access denied outside of document root


OK.. this one is driving me nuts....

I am running RH ES 4 and their standard apache server install. If I use it as it comes preconfigured with the standard docroot in /var/www/html, everything is fine. However, if I create any alias statements that reference outside of the docroot, ex) /webservices/cosmo, then I keep getting access denied - Forbidden 403 errors. I have googled for the past 4 hours and haven't found anything conclusive. Below is an excerpt of the 'cosmo' section.

<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>

Alias /cosmo "/webservices/cosmo/"
<Directory "/webservices/cosmo/">
Options +Indexes #I've also tried just Indexes (w/o the +)
AllowOverride None
Order allow,deny
Allow from all
</Directory>

I have given permissions 755 and to the entire /webservices tree. I have changed the owners and group from the root.root to apache.apache. I have restarted the services, tried rebooting the server, I am completely out of ideas. I don't remember having this problem on previous versions of Apache.

Below is the error_log contents from the point that I start the apache service and then try to access the alias '/cosmo'

[Tue Sep 20 23:20:06 2005] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Sep 20 23:20:06 2005] [info] Init: Initializing OpenSSL library
[Tue Sep 20 23:20:06 2005] [info] Init: Seeding PRNG with 256 bytes of entropy
[Tue Sep 20 23:20:06 2005] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Tue Sep 20 23:20:06 2005] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Tue Sep 20 23:20:06 2005] [info] Init: Initializing (virtual) servers for SSL
[Tue Sep 20 23:20:06 2005] [info] Server: Apache/2.0.52, Interface: mod_ssl/2.0.52, Library: OpenSSL/0.9.7a
[Tue Sep 20 23:20:07 2005] [notice] Digest: generating secret for digest authentication ...
[Tue Sep 20 23:20:07 2005] [notice] Digest: done
[Tue Sep 20 23:20:07 2005] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Tue Sep 20 23:20:07 2005] [notice] LDAP: SSL support unavailable
[Tue Sep 20 23:20:07 2005] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Tue Sep 20 23:20:07 2005] [info] Init: Initializing OpenSSL library
[Tue Sep 20 23:20:07 2005] [info] Init: Seeding PRNG with 256 bytes of entropy
[Tue Sep 20 23:20:07 2005] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Tue Sep 20 23:20:09 2005] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Tue Sep 20 23:20:09 2005] [info] Shared memory session cache initialised
[Tue Sep 20 23:20:09 2005] [info] Init: Initializing (virtual) servers for SSL
[Tue Sep 20 23:20:09 2005] [info] Server: Apache/2.0.52, Interface: mod_ssl/2.0.52, Library: OpenSSL/0.9.7a
[Tue Sep 20 23:20:09 2005] [notice] Apache/2.0.52 (Red Hat) configured -- resuming normal operations
[Tue Sep 20 23:20:09 2005] [info] Server built: Aug 31 2005 10:37:57
[Tue Sep 20 23:20:11 2005] [error] [client 127.0.0.1] (13)Permission denied: access to /cosmo denied



Thanks for any help...
Michael
 
Old 09-21-2005, 08:53 AM   #2
Gibsonist
Member
 
Registered: Mar 2004
Location: Meersburg (GER)
Distribution: Cygwin,RH 7.2 7.3, SuSe 6.4 8.2 9.1,TinyLinux, Debian Sarge, Knoppix 3.*, Knoppicilin, Knoppix STD
Posts: 191

Rep: Reputation: 30
Try setting it like this

Code:
Alias /cosmo/ /webservices/cosmo/

<Directory /webservices/cosmo/>
Options Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
 
Old 09-21-2005, 08:06 PM   #3
freedo5
LQ Newbie
 
Registered: Nov 2003
Posts: 4

Original Poster
Rep: Reputation: 0
I contacted Red Hat support and it turns out the issue is caused by the security function of SELinux which is included with RH ES3 & 4. This security feature works on top of the standard UNIX style sid & gid. Unless you want to return just to standard UNIX style security, you either have to turn off SELinux for the httpd process or update the context of files and directories that you want httpd to view.

Since httpd sets the security context for the default installation just fine, you only need to modify the context of directories outside the documentroot. Using my previous config setup, I needed to issue:

chcon -R system_u:object_r:httpd_sys_content_t webservices

for this to work successfully. Once I did that, everything began serving as it should. Thanks for those who responded though.


Last edited by freedo5; 09-21-2005 at 08:08 PM.
 
  


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
Apache 403 when changin document root. webgovernor Linux - Newbie 3 04-20-2005 12:54 AM
Error 403 Forbidden access in Apache anoop_cn Linux - Software 1 09-21-2004 09:32 AM
Apache - 403 Forbidden - Access to Subdirectories dieter Linux - Networking 2 03-25-2004 12:51 PM
Apache doesn't allow non-document-root access in default setup jenna_h Mandriva 1 10-28-2003 07:07 PM
Apache 403 Access Denied spintrance7 Linux - Software 2 10-13-2003 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:43 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