Forum Moderators: phranque

Message Too Old, No Replies

Apache can't access pages outside of document root

Apache, followsymlink, document root

         

ring0

9:43 pm on Nov 17, 2011 (gmt 0)

10+ Year Member



Ask a Question
Asked By: ring0Category: ConfigurationTags: apache, document root, followsymlink, options
I cannot get Apache to serve documents outside of document root. SeLinux status is set to disabled. The relevent sections of the httpd.conf file are as follows:

User daemon
Group daemon

DocumentRoot “/usr/local/apache2/htdocs”

Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

The permissions on the symlink are as follows:
lrwxrwxrwx. 1 root root 23 Nov 16 15:53 link -> /root/links/index2.html

The permissions on the target are as follows:
-rwxrwxrwx. 1 root root 56 Nov 16 14:06 index2.html

When browsing to [192.168.218.128...] I get an HTTP 403 Forbidden error

Server version: Apache/2.2.21
OS Linux RHEL01 2.6.32-131.6.1.el6.i686

lucy24

11:40 pm on Nov 17, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



DocumentRoot “/usr/local/apache2/htdocs”


Can we assume that was done by your text editor in the process of pasting-in your question here? It would be pretty disastrous if it's what your actual file says. (For people whose fonts don't show the difference: it's in curly quotes.)

ring0

12:49 am on Nov 18, 2011 (gmt 0)

10+ Year Member



Yes. The conference file is heavily abbreviated.

ring0

12:51 am on Nov 18, 2011 (gmt 0)

10+ Year Member



My apologies. My spell checker is extremely active.

ring0

12:55 am on Nov 18, 2011 (gmt 0)

10+ Year Member



This is pretty much the default config file. I understand that the doc root should be changed for security purposes but that wouldn't prevent options followsymlink from working would it?

phranque

10:21 am on Nov 18, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, ring0!

do you have a .htaccess file in /usr/local/apache2/htdocs?
what are the permissions for the /root/links/ directory?
have you checked your server error log file for clues?

ring0

1:35 pm on Nov 18, 2011 (gmt 0)

10+ Year Member



[error] [client 192.168.218.132] Symbolic link not allowed or link not accessible: /usr/local/apache2/htdocs/link

drwxrwxrwx. 2 root root 4096 Nov 16 19:25 links

No .htaccess files are being used.

phranque

2:51 pm on Nov 18, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



in what contexts are those Options directives?

ring0

3:17 pm on Nov 18, 2011 (gmt 0)

10+ Year Member



Wow.. I think I must've left that while cutting and pasting?

<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory "/usr/local/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Of course / was set as such for troubleshooting purposes.

BTW - Thanks for the friendly welcome!

phranque

2:37 am on Nov 19, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



does the server process also have read access to the /root directory?