Generating Apache Configurations
| From: | o dot cook at etoncollege dot org dot uk | Date: | Tue, 12 Sep 2000 17:03:17 +0000 |
| Subject: | Generating Apache Configurations | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-16399@lists.php.net to get a copy of this message | ||
This is not directly related to PHP, but I'm hoping that the people on this
list might be able to help. So, apologies in advance for this being
off-topic. A post in comp.infosystems.www.servers.unix didn't get any
replies, and I couldn't find an Apache mailing list.
I have a MySQL database containing information about various websites that I
host on my server. Fields include listening ip, domain, docroot,
transferlog, errorlog, scriptalias and redirect, amongst others.
Currently what I'm doing is getting a PHP script to write output to
/path/to/apache/sites.conf in the form
<VirtualHost ip.ip.ip.ip>
ServerAdmin webmaster@domain
DocumentRoot docroot
ServerName www.domain
ErrorLog errorlog
TransferLog transferlog
ScriptAlias /cgi-bin/ scriptalias
</VirtualHost>
I then include this into my httpd.conf with "Include
/path/to/apache/sites.conf/" and 'apachectl graceful' the server. A shell
script is called from cron every so often to update the apache
configuration.
It strikes me that this may not be the most efficient method of
configuring Apache with the information from the MySQL database.
Can anyone think of a better method?
With best wishes,
Ollie
--------------------------------------------------
Ollie Cook Mobile: +44 (7946) 057 198
PGP: http://ollie.zenox.dhs.org/pgp-key
950C 36F2 CE30 3E95 0DC3 E2A3 C3DA 59A3 53D2 9567
--------------------------------------------------