httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorge Schrauwen <jorge.schrau...@gmail.com>
Subject Re: Some ramblings on httpd config
Date Thu, 04 Jun 2009 12:14:02 GMT
On Thu, Jun 4, 2009 at 1:55 PM, Akins, Brian <Brian.Akins@turner.com> wrote:
> On 6/3/09 7:50 PM, "Plüm, Rüdiger, VF-Group" <ruediger.pluem@vodafone.com>
> wrote:
>
>> 1. There are many and large and complex configurations out in the world.
>
> Which is exactly why I want/need a better way to do them.  I'm currently
> using a template system to generate them.  However I wind up with dozens
> (and dozens) of vhosts that sometimes only vary by a statement or too.
>
On this I completely agree! Currently say fetching 100+ hosts from a
database that are basicly the same except domain, documentroot and
maybe 3 options like has php, has cgi,.. is a PITA.

mod_perl with database backend... works I guess but it's like taking a
nice car, strip the engine and gut donkey and cram the engine in the
donkey. Ok not what I wanted to write but can't describe it.

Like Graham mentioned mod_macro can be of some use here. however since
I'm looping in  perl I may as well push the 4 lines needed to httpd
instead of a one line macro replacemen.


> A contrived example:
>
>  -- lots of stuff
>  if r.hostname == "www.domain.com" then
>     -- a couple of things specific to this domain
>  elseif r.hostname == "www.domain2.com" then
> ...
>
>
> Of course, this example may could have a little lua glue to handle this
> situation.
>
>
> Also, I'm not just talking about lua being the config language, I want lua
> to "drive" the httpd process.  Ie, the above code gets ran on every request.
>
>> 2. I admit that some improvements are needed. How about an approach that
>> allows
>>    to embed a macro / scripting language into the current configuration system
>>    that allows you to do more advanced things if you need to.
>
> If we provided enough glue within our modules for lua, this this would be
> fairly easy.  I already fake this a bit with mod_lua and handlers that do
> most of the work.
> --
> Brian Akins
> Chief Operations Engineer
> Turner Digital Media Technologies
>
>

Maybe we're looking at it the wrong way?

Why not go more modular with this as well?
>From what I've understood from wrowe's explenation the internal config
tree seems very flexible so why not create multiple ways to manipulate
it?

module register "parameters,blocks,..." with the internal config
mangement thingy,
front ends then configure the modules using those interfaces.

It being a flat file, xml file, lua script, perl script,... having
little relevance to httpd itself.

Flat file would turn that info say for the command into something like
Documentroot /some/path

Lua format would turn that in something else, whilst an xml format way
turn it into <Documentroot>/some/path</documentroot>

You could keep the current method for legacy use, implement an lua one
for more advance use, xml one because somebody was bored and wanted
it. Heck even a lolcode one because you could.

even mixing could be possible, have some general stuff in flatfile,
include a lua script to generate hosts which in its turn include a
flat file with shared config for each host.

Then again it would be hard to write documentation for this. Since
"documenroot" could then have many ways to be set from a users POV :(
so maybe not a great idea.

But I'm just trowing out the whacky brain twists I have.


Jorge

Mime
View raw message