0

Are Apache httpd Define directive variables intended to be allowed to be overwritten?

For example,

Define SITE example1.com

<VirtualHost *:80>
    ServerName ${SITE}
</VirtualHost>

Define SITE example2.com

<VirtualHost *:80>
    ServerName ${SITE}
</VirtualHost>

It seems to be working, my SITE variables are being overwritten, but I won't put it into production if it's not intended to be used this way.

Looking for a canonical answer, if possible. Here's another link to more obscure docs for mod_define.

Jeff
  • 1,416
  • 3
  • 28
  • 50
  • Since the `Define variable` is intended to have the same behaviour as passing the variable with a `-D` command line argument I would advise against relying on this behaviour. – Bob Dec 20 '21 at 14:37
  • Thanks Bob, I think you're probably right. If you want to post a quick answer to backup the logic, I'll mark it as both canonical and correct since there is no documentation available to the contrary. – Jeff Dec 20 '21 at 14:41

0 Answers0