Score:0

Are Apache Define directive variables allowed to be overwritten?

dj flag

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.

cn flag
Bob
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.
Jeff avatar
dj flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.