You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Timothy Stone <ci...@petmystone.com> on 2004/03/19 20:49:15 UTC

[users@httpd] Directory is relative to???

List,

Given a main server configured with a doc root:

ServerRoot    "/path/to/server/root"
DocumentRoot  "/path/to/main/server/docroot"

<Directory />
     ...super restrictive set of permissions...
</Directory>

<Directory "/path/to/main/server/docroot">
     ...blah, blah...
</Directory>

How is a Directory container with a relative attribute in a VirtualHost 
interpreted?

<VirtualHost *>

     ServerName www.example.com
     DocumentRoot "/path/to/vhost/docroot"

     <Directory /images>
	....blah...
     </Directory>

</VirtualHost>

Is this "/path/to/vhost/docroot/images"? Or 
"/path/to/main/server/docroot/images" ?

Many thanks in advance.

Tim

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Directory is relative to???

Posted by Rich Bowen <rb...@rcbowen.com>.
On Fri, 19 Mar 2004, Timothy Stone wrote:

> List,
> 
> Given a main server configured with a doc root:
> 
> ServerRoot    "/path/to/server/root"
> DocumentRoot  "/path/to/main/server/docroot"
> 
> <Directory />
>      ...super restrictive set of permissions...
> </Directory>
> 
> <Directory "/path/to/main/server/docroot">
>      ...blah, blah...
> </Directory>
> 
> How is a Directory container with a relative attribute in a VirtualHost 
> interpreted?

>      ServerName www.example.com
>      DocumentRoot "/path/to/vhost/docroot"
> 
>      <Directory /images>
> 	....blah...
>      </Directory>
> 
> </VirtualHost>

> Is this "/path/to/vhost/docroot/images"? Or 
> "/path/to/main/server/docroot/images" ?

No. Neither one.

Directory paths that start with / are always absolute file system paths.
So in your example, it refers to the directory /images which probably
doesn't exist on most file systems.

Directory paths that don't start with / are relative to the ServerRoot,
so logs/access_log is /path/to/server/root/logs/access_log

Location, on the other hand, is a URL path. So <Location /images> would
be /path/to/vhost/docroot/images, probably, or, more accurately, the URL
http://servername/images , which is not necessarily the same thing.

More generally, if it's not giving you what you expect it to, look in
the error log and see where it thinks things are coming from.

-- 
Who can say where the road goes
Where the day flows
Only time
 --Pilgrim (Enya - A Day Without Rain)


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org