Live data from Hacker News

Should Apache replace its current httpd.conf with Lua?

thread.gmane.org

41–48 of 48 posts

Re: Should Apache replace its current httpd.conf with Lua?

#41
post #8

I prefer the nginx config style over apache2. Why the hell would anyone need a turing complete configuration file syntax?

Turing completeness is a red herring and not an argument against using a language. Turing completeness is usually practically useful only to prove that certain analyses are impossible.

As to why, sometimes you want the flexibility of inferring settings from third-party data sources, or implicitly from the layout of the directory structure, or naming conventions, or any other thing you choose to mention. IMO the power of a programmable configuration language is that the configuration need not actually be written in the language, but stored somewhere else, and just retrieved using the language.

Re: Should Apache replace its current httpd.conf with Lua?

#43
post #16

I think that config files should be simple to write DSLs, and not programming languages. For automation what is really needed is an API exported by Apache via some kind of networking (a TCP socket could do the work) that allows to configure and change the behavior at run-time via a scripting language. This way you have the best of both the words.

Have you looked at Augeas http://augeas.net ?

Augeas is:

- An API provided by a C library

- A command line tool to manipulate configuration from the shell (and shell scripts)

- Language bindings to do the same from your favorite scripting language

- Canonical tree representations of common configuration files

- A domain-specific language to describe configuration file formats

Re: Should Apache replace its current httpd.conf with Lua?

#44
post #17
post #3

Surprised to see so much discussion on that. Instead, would expect someone to simply implement it, throw it on the table, and provide instructions for building it into your own apache. If 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.

Admins are not slow to change. Operations and Corporations are slow. Admins generally have more than one version of any software running. More than you can imagen. Generally they do have development versions daily updated and built and tested under the hood. Generally they do provide support and feedback to these software by bug reports or even with changesets. But they are not slow.. most of the time they do work ou…

As someone who has been an admin (both with and without that job title), I'll say that I was slow to change, and often still am. Why? Because every change is an opportunity for something to go wrong, and in my experience, something goes mildly wrong about half the time, and catastrophically wrong way more often than it should. This is after doing all the testing that can usually be done. Either there's no testing server for this client, or you can't replicate the exact conditions of the change because you don't have another Windows 2003 SBS handy to test interaction with, or you run into lots of issues in the test and can't easily roll back to make sure that you can do it flawlessly this time...

Unless you've got an employer or client that can afford you for an additional 20 hours for each major change, everyone involved just crosses their fingers and holds their breath. I've never been an admin in an environment where there was adequate funding, though, so maybe it's just me.

Anyway, I typically put off upgrades and new installs that affected old servers (new apache modules or whatever) as long as possible.

Edit: this is why I just code, now. It's easier to write stuff that works than to find the magic this-THEN-that incantation to make someone else's stuff work. ;)

Re: Should Apache replace its current httpd.conf with Lua?

#46

#!perl

use DBI;

use Blah;

...

push @{ $VirtualHost{'*'} }, {

        	ServerAdmin     => "webmaster\@$domain",
	        ServerName      => "$domain",
                ServerSignature => "Off",
	        ServerAlias     =>  \@aliases,
	        AddHandler      =>  [qw(cgi-script .cgi)],
	
	        DocumentRoot    =>  "/home/$domain/www",

	        Alias           =>  [
			["/cgi-bin/", "/home/$domain/cgi-bin/"],
			["/stats/", "/home/$domain/stats/"],
		],
}, ...

Re: Should Apache replace its current httpd.conf with Lua?

#47
post #17

Earlier quoted context omitted.

Admins are not slow to change. Operations and Corporations are slow. Admins generally have more than one version of any software running. More than you can imagen. Generally they do have development versions daily updated and built and tested under the hood. Generally they do provide support and feedback to these software by bug reports or even with changesets. But they are not slow.. most of the time they do work ou…

As someone who has been an admin (both with and without that job title), I'll say that I was slow to change, and often still am. Why? Because every change is an opportunity for something to go wrong, and in my experience, something goes mildly wrong about half the time, and catastrophically wrong way more often than it should. This is after doing all the testing that can usually be done. Either there's no testing ser…

You are not telling something contrary what I tell. You are not slow to change. Operations are slow. You have some systems and operations on going but a change will drastically impact all the operations. You have changed yourself about the change. You know about it, but you do not know it's effects on the system. So you can't change the system right away.

I bet you tested most of the changes on your own time and on equipment when possible.

For myself I do.

Re: Should Apache replace its current httpd.conf with Lua?

#48
post #17

Earlier quoted context omitted.

Admins are not slow to change. Operations and Corporations are slow. Admins generally have more than one version of any software running. More than you can imagen. Generally they do have development versions daily updated and built and tested under the hood. Generally they do provide support and feedback to these software by bug reports or even with changesets. But they are not slow.. most of the time they do work ou…

As someone who has been an admin (both with and without that job title), I'll say that I was slow to change, and often still am. Why? Because every change is an opportunity for something to go wrong, and in my experience, something goes mildly wrong about half the time, and catastrophically wrong way more often than it should. This is after doing all the testing that can usually be done. Either there's no testing ser…

Admin work is weird because when everything's working, no one says a peep. No, "hey, great job with that update last night which we were largely unaware of because it all happened seemlessly!". It's only when something goes wrong that anyone says anything.
Post reply on HN