Web server configuration sucks.

Apache or nginx have they're own custom configuration language and I don't understand why.

We've plenty of languages to work with: why we should learn some another custom commands with enigmatic commands for weird stuffs.

I'm not a python funboy but, a web server with python based configuration file will be so easy to setup and to maintain.

  • 6
    You have literally two formats to learn. One if you don't care about Apache. Sure, YAML is nice and all, but nginx is over 15 years old, and Apache 25
  • 7
    Don't bind configuration to a programming language.

    Configuration is data.

    Keep it simple please and as far away from programming languages as possible.

    DSL is enough.

    Don't mix programming with something that needs to be precise and human understandable.

    YAML is already a PITA - don't make it worse.
  • 2
    Hard disagree.

    With terraform and ansible, you can basically write down your server configuration in a few config files and it's reproducible everywhere.

    Your server can be as complicated or as simple as you'd like. And once you have got it working the way you like you can always set it up that way again.
  • 0
    @intrusioncm that's the point. Web server should not be configurable but programmable.

    Also Programming languages are precise and human readable.

    I can't understand why I need some fancy configuration command to do some simple logic
  • 5
    @cyberpro4 it's the other way around.

    A service (web server) fulfills a certain need.

    It hides it's inner way of working as much as possible.

    It provides you via a DSL / configuration a way to specify what you want to do.

    You don't program a service - you instruct it.

    Configuration is in most cases not fancy. It's a DSL (domain-specific language).
  • 5
    @IntrusionCM I totally agree, the config of apache is designed to be easy to configure and also easy to use hierarchal configurations so you do not have to repeat to much.

    Webpack uses js for config and while it is powerful it also makes most examples extremely difficult to understand and combine since many use their own internal functions that you would also have to have and know and when you open an unknown project you cannot just read the config, you have to learn their own special variety of it.

    And while python is older than Apache by some 4 years, apache built on another one that was developed almost the same time as python.

    And it took python some time to grow in popularity so at the time the apache config was invented, if they had looked at an interpreted language it could as well have been basic ;)

    And I do not think anyone would have liked that ;)
  • 4
    @Voxera that's true.

    And you gave an good example why a DSL is necessary / wise.

    A programming language can change over time, having API -/ ABI breaks.

    A DSL shouldn't change at all. It should be consistent, as every change in a DSL would lead to all users of the service needing a upgrade...
  • 4
    @IntrusionCM It also avoided countless wasted hours porting existing configs for dealing with breaking changes in Python even in minor releases, not to mention the whole Python 2 to Python 3 process.

    You just don't want to base long-term projects like web servers on such a language. Having the DSL under control is a major point.
Add Comment