[Solved] How to avoid the duplicate config variable error?
The problem for me is that our environment is such, that a change in the lighttpd configuration are coming from different places in both the main conf file and also in conf.d/ folder.
If there is a definition in the
lighttpd.conf, let's say server.tag = "abc",
and another one server.tag = "" in conf.d/31-common.conf,
this causes the server not being able to start. (Duplicate config variable in conditional 0 global: server.tag)
Is there a way to avoid this? Something like, saying that the configurations from conf.d to override the one from lighttpd.conf if duplicates?
All suggestions will be very appreciated.
The current version, I'm using is 1.4.29.
dont do duplicate config options.
I don't have much control of this.
That is why, I'm looking for any other solution.
and why dont you have control over the config?
You shouldn't be so condescending.
Main and default configuration variables should be overrideable in a local include. That's what the whole concept is for.
It's not just in situations like the op finds himself in. Also, when debian (or any other updateable Linux) ships new config files with new defaults, one always has to implement ones changes into the new default config. Error prone and tedious, and unnecessary, if local includes can override. Other applications manage that just fine; would be nice if lighttpd could.
And just as a side note, duplicate variables are a reason for a warning, not for a service denial.
RE: [Solved] How to avoid the duplicate config variable error? - Added by gstrauss about 5 years ago
Upcoming lighttpd 1.4.46 release will allow syntax
:= in addition to
= for assignment.
:= will override the prior value. YMMV depending on how sane your configuration is. See 367e62c1