[SWLUG] Restart Apache from php
Dick Porter
dick at acm.org
Fri Jan 21 15:08:27 UTC 2005
On Fri, 2005-01-21 at 14:27 +0000, Toby Maxwell-Lyte wrote:
> On 21 Jan 2005 at 13:54, justin at discordia.org.uk wrote:
>
> > On 21 Jan, Toby Maxwell-Lyte wrote:
> > > I guess I could store the desired domain names in a mysql db.
> > > I could write a perl script that checked this db for entries and
> > > then created new virtual hosts accordingly. I could then setup a
> > > cronjob to run this script every 5 minutes.
> >
> > Apache does have support for multiple VirtualHosts without needing any
> > config file changes or restarting.
> >
> > ive never tried it myself, but read here
> > http://httpd.apache.org/docs-2.0/vhosts/mass.html
>
> Thanks, I had seen that and unfortuantely the sites are not
> necessarily stored in a directory that matches the domain name. The
> sites are created dynamically therefore they're stored in directories
> that have an integer that increases in value for each new site. This
> makes it far easier for programmatic reasons.
If you need a unique key, then surely the domain name is unique?
If you absolutely have to have a numeric directory, then a 5-minute cron
job that looks up the list of domain names in your database and links
them to the directory (with the appropriate symlink handling in
httpd.conf) will be a lot easier.
- Dick
More information about the Swlug
mailing list