Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is it possible to include a windows enviroment variable in an httpd.conf?

Ideally I would like to set DocumentRoot to something like %PROGRAMDATA%\MyCompany\MyApp\htdocs.

Background: I'm trying to make a custom apache installer as part of a larger project. I could make installer write an absolute path into httpd.conf, but I'd prefer to keep the conf file portable if possible.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Based on this bug report it would appear that environment variable expansion in configuration files on Windows is a valid feature in Apache. Looks like you can use the same syntax as environment variable expansion that you would for Apache on a *nix OS-- ${variable_name}.

share|improve this answer
    
Excellent, thanks –  Twelve47 Apr 14 '11 at 14:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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