0

I have multiple sites working on one Server (running Ubuntu 12.04.4) and the sites all work fine. The issue I'm having trouble finding any information on is this: Is there a way to control the $ENV variable based on which site is being served?

For example: if the $ENV{'SERVER_NAME'} is set to example.com - and the site being view is foo.com, an older perl script is capturing the wrong value for foo.com. It would be best if I could control what the value of $ENV{'SERVER_NAME'} based on the site... is it possible?

Thank you...

3
  • Every web server software I've worked with has that as a variable, but you'd need to look at the documentation for whatever server it is you're using.
    – Jenny D
    Apr 10, 2014 at 8:13
  • Dear Katherine Villyard - I just to happen to be a "professional"... I get paid to do LAMP Stack development (as in Linux and Apache). It just so happens that every "professional" doesn't know the answer to every question... and I looked around a lot before asking. Since the availability of an answer for this was sparse I would think it would be a good question for others looking.
    – Kirk B
    Apr 11, 2014 at 18:48
  • A professional should be able to craft a question containing basic information, such as which web server they're using, and also be able to search the documentation site for that web server. If you'd started with using the search function on http.apache.org, you would not have needed to even write the question.
    – Jenny D
    Apr 12, 2014 at 18:56

1 Answer 1

0

Apache allows you to set environment variables in the virtual host, directory and even .htaccess configuration context with mod_env

SetEnv  variable-name value
PassEnv variable-name
0

Not the answer you're looking for? Browse other questions tagged .