On Jun 9, 2009, at 08:49, Akins, Brian wrote:

Some pseudo request processing code to do same thing:
if listening_port == 80 then
    if r.hostname == 'www.foo.com' then
        ....
    elseif r.hostname =~ /www\d.bar.[org|net]/
    end
end


As long as we're talking about exposing nifty syntax in the config ...

I'd be content (at least briefly - I'm sure I could find something else to be discontent about) if virtual hosts were less baffling, or, at least, harder to get wrong. Something like:

<Interface 10.0.0.1:80>
  <Websites example.com www.example.com foo[123].example.org>
      DocumentRoot /x/y
  <Websites>

  <Websites __dynamic__ >
      DocumentRoot /var/vhosts/HOSTNAME
      CustomLog /var/log/HOSTNAME.log combined
  </Websites>
</Interface>

And perhaps something fancier regexey to encompass all of the magic that mod_vhost_alias does.

Or something like that that's sufficiently like what we have now to be easy to learn, but sufficiently different to be harder to get wrong, and a whole heck of a lot easier to do dynamic vhosts.

One of the other big complaints that comes up, in various ways, daily on IRC, is that there's no standard way to put variables in configuration directives. If we had a standard set of variables (like, say, HOSTNAME or whatever) that could be interpolated into config directives, as well as a standard way to do variable assignment and backreferences, that would solve a whole class of problems that are really pretty difficult right now.

Of course, I say all of that being utterly ignorant of how this all works internally, so feel free to ignore me. Like I said before, I answer the "how do I" questions every day, and frequently find myself wondering why things that *sound* so easy are actually so very difficult.


--
A poet more than thirty years old is simply an overgrown child.
H. L. Mencken

Reply via email to