Mailing List Archive

Changing DocumentRoot based on path
Hi,

On my domain, I host a rather large amount of sites, they are based on
paths like this:

http://www.domain.com/SITE1/
http://www.domain.com/SITE2/

(Where SITEX is just a normal verb for the site).

On the server, all sites are putted into the same directory, and then
the different sites exists in subdirectories:

/www | Main site
/www/SITE1 | Sample site
/www/SITE2 | Another sample site

All users are chrooted via FTP to their respectively homedirs
(/www/SITEX/). But how can I "chroot" in Apache as well?

The problem lies in the fact, that users can "see" the whole domain, by
using scripts. So SITE2 can actually write a script which reads files
in SITE1.

The optimal solution would be if every site could have their own
DocumentRoot, but I don't see any way of doing this, as it only applies
in the server configuration and in virtual hosts.

I would also like to have the system just a little dynamic, so there is
a minimum of fiddling with config files, whenever a site is added.

Thanks in advance.

- Morten.

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org
RE: Changing DocumentRoot based on path [ In reply to ]
> From: Morten Brix Pedersen [mailto:mbp@wtf.dk]

> The problem lies in the fact, that users can "see" the whole domain, by
> using scripts. So SITE2 can actually write a script which reads files
> in SITE1.

Fiddling with the DocumentRoot is not going to help you with that problem.
In fact, if you are talking about module-based scripting (php, mod_perl),
then there is really nothing you can do about this. Users will be able to
read anything that the web server has access to. The only solution is to
run separate instances of apache under different userids for each host.

Joshua.


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org