Mirror apache2 configuration across multiple servers in cluster
am 27.11.2007 18:52:51 von JamesG
Hi,
I have several servers running behind a load balancer.
It is somewhat tedious to copy all the virtual hosts etc across to a
new server as it is added to the cluster.
My question is, can i possibly mirror the apache2.conf and sites-
available folder between all servers?
Of course the virtualhosts are different because they specific the IP
per server so this isn't very straight forward.
any ideas?
Thanks
Re: Mirror apache2 configuration across multiple servers in cluster
am 27.11.2007 19:40:26 von Jim Hayter
JamesG wrote:
> Hi,
>
> I have several servers running behind a load balancer.
> It is somewhat tedious to copy all the virtual hosts etc across to a
> new server as it is added to the cluster.
>
> My question is, can i possibly mirror the apache2.conf and sites-
> available folder between all servers?
>
> Of course the virtualhosts are different because they specific the IP
> per server so this isn't very straight forward.
>
> any ideas?
>
> Thanks
This is what I do. Note - I suspect there are easier ways, this works
for me.
I keep my configuration files in SCCS in an NFS directory available to
all the web servers. The configuration files include some "tokens" that
will be replaced by values that differ by web server (hostname, IP
address, log file prefix (usually hostname), and office IP range).
After making a configuration change and committing it to SCCS, I run a
script that gets the current version of all configuration files in a
"current" directory on the NFS server. Then (on each webserver), I run
a script (link to NFS server - so one copy) that copies the "current"
files to the web server and replaces the tokens with the appropriate values.
This is working for me with 6 production web servers. It gets to be a
bit of a pain. At some point, I'd like to write something to automate
the copying and token replacement steps that I can run once to perform
those tasks on each web server.
Note that this still leaves the server graceful restart/start and stop
to be done manually on each web server.
HTH,
Jim