This is a discussion on Re: automatic Virtual Host within the Apache Web Server forums, part of the Web Server and Related Forums category; On Mon, 21 Jul 2003 13:54:09 +0200, Florent <superfc@superfc.dyndns.org> wrote: >So, I ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On Mon, 21 Jul 2003 13:54:09 +0200, Florent
<superfc@superfc.dyndns.org> wrote: >So, I would like to have an apache configuration, wich looks like : >DocumentRoot: /home/<domain>/<sub-domain> maybe you can get some ideas from the mass vhost part in the documentation, can be found here or on million other places: http://www.ipv6.berkom.de/manual/vhosts/mass.html BUT this does not exactly offer what you want. You want your users to create a directory that will be served as a subdomain, right? This implies that not only apache conf has to change but also some changes to your nameserver have to be done. You wonīt get a simple dynamic solution for that, but it is not very complicating to write some script, that does exactly what you want. A common pitfall with directory-based vhosts and one of the really stupid siteeffects in Apache is the fact, that a missing directory for a vhost will lead to Apache NOT starting for all other hosts next time you restart it. Maybe there is some option to change this, but I did not found anything. Try it yourself. make a vhost and delete / rename the relating directory. You get it? Regarding your wanted configuration this means that if a user can write, that means also delete/rename, a directory for a vhost, every user on that machine will be able to DOS your whole Apache Service just by deleting itīs directory. Lots of work after next apacherestart. So only root or at least some kind of maintainance-user should have write permissions to that important vhost-related directory, NOT your webhosting users. The best thing for your problem will be writing some kind of simple admin-script that will write a new line to your zone-files, create a dir, change / create vhost for that dir, reload apache. Then write a web-frontend to that script and go to sourceforge and publish it to get some other people take a look at it to make sure, there are not too many bugs. You could also look for existing hosting automation solutions on sourceforge or freshmeat. Have a nice thread, Peter |