Should Apache replace its current httpd.conf with Lua?
thread.gmane.org
Should Apache replace its current httpd.conf with Lua?
1–10 of 48 posts
Re: Should Apache replace its current httpd.conf with Lua?
#2Its probably a good idea to move in this direction in the long run, but there is always a risk of displeasing your current users.
Re: Should Apache replace its current httpd.conf with Lua?
#3If it catches on, then you have a replacement to the current config syntax.
That said, in my experience, admins are slow to change. There are still sites running Apache 1.3 out there.
Re: Should Apache replace its current httpd.conf with Lua?
#4Re: Should Apache replace its current httpd.conf with Lua?
#5The lua interpreter is essentially just a "code = read(); f = compile(code); print f()" loop written in the C API, with better error messages. The C API is primary, not the standalone language, and using it with existing C projects is quite easy. (As a language, it's very much like a twin of Javascript that was able to mature for another decade, rather than suddenly getting standardized. Most of the flaws Crockford describes in "Javascript: The Good Parts" were fixed in long ago in Lua.)
More specifically relevant to apache, running code in a sandbox is trivial. You can use setfenv() to control the environment, global packages, etc. available to any code. If code shouldn't access the compiler, OS or debug packages, etc., just pass it an environment without them.
There's also a chapter in _Lua Programming Gems_ (http://www.lua.org/gems/) (it's "Lua as a Protocol Language" by Patrick Rapin, no sample PDF though) that shows how to set up a simple filter at the bytecode level to block loops, guaranteeing that code will always terminate. With a few minor changes, it's completely safe to use as a network protocol language.
Re: Should Apache replace its current httpd.conf with Lua?
#6Let's just hope they don't switch to an XML based configuratino file. We don't need even more filler-code in our configuration files.
XML just isn't human readable (and writable! and, yes, you DO write configuration files here and then) enough to be convenient. IMHO at least.
Re: Should Apache replace its current httpd.conf with Lua?
#7Its a neat idea, but I would echo the sentiment brought up in the thread linked that casual users would have a much harder time with a lua config in comparison to the current one. Its probably a good idea to move in this direction in the long run, but there is always a risk of displeasing your current users.
Re: Should Apache replace its current httpd.conf with Lua?
#8Re: Should Apache replace its current httpd.conf with Lua?
#9Its a neat idea, but I would echo the sentiment brought up in the thread linked that casual users would have a much harder time with a lua config in comparison to the current one. Its probably a good idea to move in this direction in the long run, but there is always a risk of displeasing your current users.
Given the complexity to which apache and its ecosystem has grown and the consequences for screwing up this configuration task, this seems quite similar to sendmail in that I think a reasonable argument can be made that casual users should not be configuring this particular system. Period.
Like I said, in the long run, it might be better to make the switch, but a change can cause significant risk/inconvenience to casual users or users who have such complicated configurations it would require significant time to replicate in another format.
Re: Should Apache replace its current httpd.conf with Lua?
#10I wonder what is wrong with the current way of configuring apache. I might be biased, but I have experience with both lighttpd and apache and I always found the apache way of doing things perfectly fine and actually prefer it to the kind-of procedural style of lighty. Let's just hope they don't switch to an XML based configuratino file. We don't need even more filler-code in our configuration files. XML just isn't hu…
I also don't mind the current config file, but I've been using Apache for more than 10 years so I've probably lost all perspective at this point. Having the config file in Lua would certainly make it eaiser to automate, validate and document though.