Linking to directory outside document root

This is a discussion on Linking to directory outside document root within the Apache Web Server forums, part of the Web Server and Related Forums category; I have files that I want to serve up in apache on linux. Running Apache/2.2.2 (Fedora) the ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-12-2008
spacemancw
 
Posts: n/a
Default Linking to directory outside document root

I have files that I want to serve up in apache on linux.
Running Apache/2.2.2 (Fedora)

the files are in a folder call fs in my home dir /home/vsite

/home/vsite/fs

drwxr-xr-x 2 vsite vsite 12288 Mar 12 07:50 fs

an example file
-rw-r--r-- 1 vsite vsite 3533 Mar 12 12:55 file1.html

The DocumentRoot is :
DocumentRoot "/var/www/html"

I made a link inside /var/www/html
lrwxrwxrwx 1 root root 14 Mar 12 13:01 fs -> /home/vsite/fs

I try to go to the file1.html as follows:

http://10.3.3.131/fs/file1.thml and get forbidden .....

Forbidden
You don't have permission to access /fs/ on this server.
--------------------------------------------------------------------------------
Apache/2.2.2 (Fedora) Server at 10.3.3.131 Port 80


I also have this in my httpd.conf

<Directory "/home/vsite/fs">
Order allow,deny
</Directory>


<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>


Also

I tried to change the DocumentRoot to "/home/vsite/fs"
but apache won't start when I have
DocumentRoot "/home/vsite/fs"


solving either of the above would be fine

thanx

Roger








  #2 (permalink)  
Old 03-13-2008
phantom
 
Posts: n/a
Default Re: Linking to directory outside document root

"spacemancw" <spacemancw@yahoo.com> wrote in message
news:2f595b9b-8379-44e4-9cc8-931c248b2d89@y77g2000hsy.googlegroups.com...
>I have files that I want to serve up in apache on linux.
> Running Apache/2.2.2 (Fedora)
>
> the files are in a folder call fs in my home dir /home/vsite
>
> /home/vsite/fs
>
> drwxr-xr-x 2 vsite vsite 12288 Mar 12 07:50 fs
>
> an example file
> -rw-r--r-- 1 vsite vsite 3533 Mar 12 12:55 file1.html
>
> The DocumentRoot is :
> DocumentRoot "/var/www/html"
>
> I made a link inside /var/www/html
> lrwxrwxrwx 1 root root 14 Mar 12 13:01 fs -> /home/vsite/fs
>
> I try to go to the file1.html as follows:
>
> http://10.3.3.131/fs/file1.thml and get forbidden .....
>
> Forbidden
> You don't have permission to access /fs/ on this server.
> --------------------------------------------------------------------------------
> Apache/2.2.2 (Fedora) Server at 10.3.3.131 Port 80
>
>
> I also have this in my httpd.conf
>
> <Directory "/home/vsite/fs">
> Order allow,deny
> </Directory>
>

The above section is incomplete - you've told apache what order your
allow/deny directives will appear, but you haven't used any.
add an allow directive:

<Directory "/home/vsite/fs">
Order allow,deny

Allow from all
</Directory>


 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:05 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0