modperl-handling_complex_httpd_conf_files_heavy_and_light_versions_for_multiple_vhosts_etc

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Date: Sat, 30 Sep 2000 16:37:51 -0300
From: martin langhoff <martin@scim.net>
To: "modperl@apache.org" <modperl@apache.org>
Subject: One httpd.conf for both apache heavy and apache-light [IfModule]

hi,

	I'm trying to build a 2 tiered Apache setup, with one light httpd, one
mod_perl httpd and a mod_php4 httpd, all running on different ports on
the same machine/IP. Right now I'm solving the mod_rewrite mod_proxy
stuff (I want the light httpd to transparently proxy requests to the 2nd
tier httpd daemons). 

	What I see in the not-so distant future is a hell of a configuration
nightmare. From the start, this box should be hosting about 30 vhosts,
and I don't really want to keep them in synch across 3 different files.
So I thought of using a single monolithic  vhosts.conf with lots of
IfModule sections. 

	Is anyone using this directive?
	Am I getting in a mess? 

===

Date: Sat, 30 Sep 2000 12:49:40 -0700
From: Perrin Harkins <perrin@primenet.com>
To: martin langhoff <martin@scim.net>
Subject: Re: One httpd.conf for both apache heavy and apache-light [IfModule]

martin langhoff wrote:
>         What I see in the not-so distant future is a hell of a configuration
> nightmare. From the start, this box should be hosting about 30 vhosts,
> and I don't really want to keep them in synch across 3 different files.
> So I thought of using a single monolithic  vhosts.conf with lots of
> IfModule sections.

That could work.  So could <IfDefine heavy>, where you start your heavy
httpd with a -Dheavy.  Where I work, we use Template Toolkit to generate
variations from one httpd.conf template.

===

Date: Sat, 30 Sep 2000 21:53:33 +0200
To: martin langhoff <martin@scim.net>
From: Robin Berjon <robin@knowscape.com>
Subject: Re: One httpd.conf for both apache heavy and apache-light
Cc: "modperl@apache.org" <modperl@apache.org>

At 16:37 30/09/2000 -0300, martin langhoff wrote:
>	I'm trying to build a 2 tiered Apache setup, with one light httpd, one
>mod_perl httpd and a mod_php4 httpd, all running on different ports on
>the same machine/IP. Right now I'm solving the mod_rewrite mod_proxy
>stuff (I want the light httpd to transparently proxy requests to the 2nd
>tier httpd daemons). 
>
>	What I see in the not-so distant future is a hell of a configuration
>nightmare. From the start, this box should be hosting about 30 vhosts,
>and I don't really want to keep them in synch across 3 different files.
>So I thought of using a single monolithic  vhosts.conf with lots of
>IfModule sections. 
>
>	Is anyone using this directive?
>	Am I getting in a mess? 

It is indeed a bit of a configuration nightmare when vhosts add up (even
though it's well worth the trouble). What I do is use both IfModule to
merge both confs and mod_macro to factor out the repetitive bits. It works
quite well and at any rate the win of splitting into two httpds overweighs
the configuration overhead, but I'm still not completely happy. Half of me
is thinking about using Include to try and break up the conf file into
smaller bits and the other half wants to write something that would help
automate the configuration completely. It's possible on the mod_perl side
if you write your conf in Perl, but it's more troublesome on the plain
Apache side. If anyone has a silver bullet for this (well, I'll settle for
a good solution that makes my life easier ;) I'd gladly hear it.


===

Date: Sat, 30 Sep 2000 17:11:09 -0300
From: martin langhoff <martin@scim.net>
To: perrin@primenet.com
Subject: Re: One httpd.conf for both apache heavy and apache-light [IfModule]

You mean you post-process your httpd.conf ? Phew!

mmmh. I'm flabbergasted (sp?) and certainly mesmerized, can you tell us
a bit more? 

Perrin Harkins wrote:
> Where I work, we use Template Toolkit to generate
> variations from one httpd.conf template.

===

Date: Sat, 30 Sep 2000 13:39:45 -0700
From: Perrin Harkins <perrin@primenet.com>
To: martin langhoff <martin@scim.net>
Subject: Re: One httpd.conf for both apache heavy and apache-light [IfModule]

martin langhoff wrote:
> 
> You mean you post-process your httpd.conf ? Phew!
> 
> mmmh. I'm flabbergasted (sp?) and certainly mesmerized, can you tell us
> a bit more?

It's pretty simple.  We have a file with the varying bits of info in it
(MaxClients, MaxRequestsPerChild, etc.) and a small program that accepts
a name to use as a key into this file.  It takes the hash of data from
the file and runs it through the httpd.conf template using TT, which
allows us to do loops, conditionals, or even in-line perl if we wanted
to.

This all happens as an installation step, so it's an extra step compared
to IfModule tricks that happen on the fly.  It does have an advantage in
that you can use it to handle configuration variations for QA and
development systems.

===

Date: Sat, 30 Sep 2000 18:03:42 -0300
From: martin langhoff <martin@scim.net>
To: "modperl@apache.org" <modperl@apache.org>
Subject: Re: One httpd.conf for both apache heavy and apache-light [IfModule]

Perrin, Robin, et al


        at least I don't feel alone on this one :) 

        now let me seize the opportunity and (while you're
around, having admitted you're using a 2 tiered apache
setup,) ask you if you are doing the mod_rewrite/mod_proxy
trick, and how were you able to pull it off.

        I'm reading the mod_rewrite guide right now and my
head *is* spinning.

===

To: martin langhoff <martin@scim.net>
Cc: "modperl@apache.org" <modperl@apache.org>
Subject: Re: One httpd.conf for both apache heavy and apache-light [IfModule]
From: David Hodgkinson <daveh@hodgkinson.org>
Date: 30 Sep 2000 22:17:33 +0100

martin langhoff <martin@scim.net> writes:

>         I'm reading the mod_rewrite guide right now and my head *is*
> spinning.

Remind me to write up my experiences.

I did this a couple of weeks ago on a five-machine setup and it's
worth documenting for peer review... 

(Like to see if I missed anything obvious :-)


===

From: "Les Mikesell" <lesmikesell@home.com>
To: "martin langhoff" <martin@scim.net>, "Robin Berjon" <robin@knowscape.com>
Cc: <modperl@apache.org>
Subject: Re: One httpd.conf for both apache heavy and apache-light [IfModule]
Date: Sat, 30 Sep 2000 17:11:45 -0500

"Robin Berjon" <robin@knowscape.com> wrote: 

> It is indeed a bit of a configuration nightmare when vhosts add up (even
> though it's well worth the trouble). What I do is use both IfModule to
> merge both confs and mod_macro to factor out the repetitive bits. It works
> quite well and at any rate the win of splitting into two httpds overweighs
> the configuration overhead, but I'm still not completely happy. Half of me
> is thinking about using Include to try and break up the conf file into
> smaller bits and the other half wants to write something that would help
> automate the configuration completely. It's possible on the mod_perl side
> if you write your conf in Perl, but it's more troublesome on the plain
> Apache side. If anyone has a silver bullet for this (well, I'll settle for
> a good solution that makes my life easier ;) I'd gladly hear it.

The problem with conditionals and includes is that the light/heavy httpds
tend to have almost nothing in common except the DocumentRoot and
they may not even be on the same machines.  Some sort of template
mechanism might work with postprocessing to spit out the front and
back end config files, but then you have yet-another-syntax to learn.
I usually just open both files in different windows and cut and paste
to make any common changes.



===

Date: Sun, 01 Oct 2000 00:43:24 +0200
To: martin langhoff <martin@scim.net>
From: Robin Berjon <robin@knowscape.com>
Subject: Re: One httpd.conf for both apache heavy and apache-light
Cc: "modperl@apache.org" <modperl@apache.org>

At 18:03 30/09/2000 -0300, martin langhoff wrote:
>        at least I don't feel alone on this one :) 

Oh no you're not ;)

>        now let me seize the opportunity and (while you're around,
>having
>admitted you're using a 2 tiered apache setup,) ask you if you are doing
>the mod_rewrite/mod_proxy trick, and how were you able to pull it off. 

Most of the sites that I produce have a lot of static content and just a
few dynamic pages and the exceptions are nearly 100% routed through
mod_perl, whichis fairly easy. I don't use mod_rewrite for the former, the
following suffices:

ProxyPass         /mperl/ http://www.url.net:8000/mperl/
ProxyPassReverse  /mperl/ http://www.url.net:8000/mperl/

Then anything that's accessed under /mperl is treated by the mod_perl
backend. For the latter I use various combinations of FileMatch or
mod_rewrite depending on the setup. It's usually fairly simple.

>        I'm reading the mod_rewrite guide right now and my head *is*
>spinning.

It's quite a good guide but it has to get one's head spinning. Remember the
first time you read about Perl regexes :)

===

From: Vivek Khera <khera@kciLink.com>
Date: Sun, 1 Oct 2000 21:07:43 -0400 (EDT)
To: "modperl@apache.org" <modperl@apache.org>
Subject: Re: One httpd.conf for both apache heavy and apache-light [IfModule]

>>>>> "ml" == martin langhoff <martin@scim.net> writes:

ml> Perrin, Robin, et al
ml>         at least I don't feel alone on this one :) 

ml>         now let me seize the opportunity and (while you're around,
ml> having
ml> admitted you're using a 2 tiered apache setup,) ask you if you are doing
ml> the mod_rewrite/mod_proxy trick, and how were you able to pull it off. 

I've posted complete copies of my live www.morebusiness.com httpd
configs for the lightweight proxy front end and the mod_perl backend.
Check the list archives for it.

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu