Perl scripts to automatically update zone files?
Simon at wretched.demon.co.uk
Mon Jun 24 17:44:30 UTC 2002
Crazy Diamond wrote:
> I have a box running apache and bind here at the University of
> Massachusetts Lowell and we want to set up apache and bind so that
> people can set up web sites automatically using virtual hosting
> through a perl script. So, for example, say our domain name is
> abcd.com and a user creates a website, the script would automatically
> create a virtual host in apache called xyz.abcd.com.
> The question to this group is, does anyone here know a PERL script
> that will automatically stop named, append the subdomain to the zone
> file i specify, and then restart the name daemon?
Just use "nsupdate" to add it dynamically - it is a one line
command for the BIND part, and I assume Apache can't be much
harder to do, assuming you just want a record for xyz. You can't
add new zone files - but then you probably don't need to.
Of cource the traditional approach is to use /~username, and map
the user a public HTML directory (usually $HOME/public_html,
which is fine for most people, although obviously we are all a
lot more security aware these days.
More information about the bind-users