You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Farid Hamjavar <ha...@unm.edu> on 2002/02/13 23:45:13 UTC

keeping multiple httpd.conf synchronized


apache-1.3.22-2 (linux 2.4 kernel).


Greetings,

I  was wondering  what strategies  other admins  employ when
there are  multiple web-servers  running apache in  terms of
keeping the httpd.conf synchronized?

I  am asking  the  question above  based  on the  assumption
that the  httpd.conf for web-server-1 and  web-server-2 thru
web-server-N  are  %100 identical  and  differ  only in  the
occurrence of server name and IP#.


Thanks, 
Farid 
UNM-CIRT




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: keeping multiple httpd.conf synchronized

Posted by Mark Foster <md...@enic.cc>.
I'm not sure if this will help you or not, but here's a trick I have
used in the past. Works on unix (linux & freebsd, others I'm sure).

Let's say you have three apache headends that all have the same
httpd.conf file info, except for the IP and hostname of the box is
different for each (naturally).

For headend#1 (he1) you might have a line like this in /etc/hosts...
192.128.15.12	he1 www

For headend#2 (he2) you would have this line
192.168.15.13	he2 www

and so on. This enables you to use
<VirtualHost www> in your httpd.conf making them all identical.

On Wed, 2002-02-13 at 15:05, jon schatz wrote:
> On Wed, 2002-02-13 at 14:45, Farid Hamjavar wrote:
> > I  am asking  the  question above  based  on the  assumption
> > that the  httpd.conf for web-server-1 and  web-server-2 thru
> > web-server-N  are  %100 identical  and  differ  only in  the
> > occurrence of server name and IP#.
> 
> one way is to compile in mod_perl, and use the Perl directive. This
> example config would take the servername and ip from the current machine
> info (web-server-N):
> 
> httpd.conf:
> <--snip-->
> <Perl>
> chomp(my $hostname = `hostname`);
> my $ip = join ".", unpack('C4, gethostbyname($hostname));
> $Listen = "$ip:80";
> $ServerName = $hostname;
> </Perl>
> 
> the perl configuration directives are pretty powerful...
> 
> -jon
> 
> -- 
> jon@divisionbyzero.com || www.divisionbyzero.com
> gpg key: www.divisionbyzero.com/pubkey.asc
> think i have a virus?: www.divisionbyzero.com/pgp.html
> "You are in a twisty little maze of Sendmail rules, all confusing." 
-- 
-mdf [Mark D. Foster]                          Phone: 206-381-0449
System Administrator - eNIC Corporation          Fax: 206-329-7107
<md...@enic.cc> or mergatroid on AIM 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: keeping multiple httpd.conf synchronized

Posted by jon schatz <jo...@divisionbyzero.com>.
On Wed, 2002-02-13 at 14:45, Farid Hamjavar wrote:
> I  am asking  the  question above  based  on the  assumption
> that the  httpd.conf for web-server-1 and  web-server-2 thru
> web-server-N  are  %100 identical  and  differ  only in  the
> occurrence of server name and IP#.

one way is to compile in mod_perl, and use the Perl directive. This
example config would take the servername and ip from the current machine
info (web-server-N):

httpd.conf:
<--snip-->
<Perl>
chomp(my $hostname = `hostname`);
my $ip = join ".", unpack('C4, gethostbyname($hostname));
$Listen = "$ip:80";
$ServerName = $hostname;
</Perl>

the perl configuration directives are pretty powerful...

-jon

-- 
jon@divisionbyzero.com || www.divisionbyzero.com
gpg key: www.divisionbyzero.com/pubkey.asc
think i have a virus?: www.divisionbyzero.com/pgp.html
"You are in a twisty little maze of Sendmail rules, all confusing."