Hi,

is there any method/module that will allow me to use enviroment variables in httpd.conf?

Specifically, I want Apache to run straight from a cd in Ms. Windows, and I require a temporal directory and other settings currently hard coded, like this:

Listen localhost:8080
PidFile c:/temp/apache/apache_httpd.pid
ErrorLog c:/temp/apache/apache_error.log
CustomLog c:/temp/apache/apache_access.log common
Alias /cgi_tmp/ c:/temp/apache/cgi_tmp/

but not everyone has the needed write permission or, alas, even a C: drive, so I would hope something like this is possible:

autorun.bat:
set APACHE_PORT=8080

if not exist %TEMP%\apache md %TEMP%\apache > NUL
if not exist %TEMP%\apache\cgi_tmp md %TEMP%\apache\cgi_tmp > NUL

start /min \Apache\bin\Apache.exe
sleep 5

start http://localhost:%APACHE_PORT%/


httpd.conf:
Listen localhost:%{ENV:APACHE_PORT}
PidFile %{ENV:TEMP}/apache/apache_httpd.pid
ErrorLog %{ENV:TEMP}/apache/apache_error.log
CustomLog %{ENV:TEMP}/apache/apache_access.log common
Alias /cgi_tmp/ %{ENV:TEMP}/apache/cgi_tmp/
PassEnv TEMP

I know I could copy the conf files to the hard drive and replace the paths there but I'd prefer a cleaner solution.

Also, for an extra point, I would like suggestions on how to check if a port is available for Apache prior to running it, from a .bat file.

Thanks in advance.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
  "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to