0

I'd like to run my website in two different modes: dev, and test. I currently have the site set up in /var/www/mywebsite.com and working fine. Now I'd like to set up a different url that points to the same files, but has only one difference: apache's setEnv. I want to setEnv APP_ENV test so I can then hit http://test.mywebsite.com/ and read that APP_ENV in PHP. Is this possible?

2

The Apache docs say that virtualhost is a valid context, and that declaring it with no value sets it to empty. Just do this (haven't tested, GL :-)

<VirtualHost dev.mysite.xyz:80>
  ...
  SetEnv
  ...
</VirtualHost>
<VirtualHost test.mysite.xyz:80>
  ...
  SetEnv APP_ENV 
  ...
</VirtualHost>
  • This is more or less what I ended up doing. In my particular case it was easier to do this, but use a different port instead of a different subdomain. – wulftone Jun 27 '14 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.