Forum Moderators: phranque
So far, I haven't figured out how to do this. Here's what I've got so far, is this possible?
Thank You,
Troy
<VirtualHost *:80>
SetEnv PRIMARY_DOMAIN test.com
DocumentRoot /w3/${PRIMARY_DOMAIN}/
ServerName ${PRIMARY_DOMAIN}
DirectoryIndex index.html
CustomLog logs/${PRIMARY_DOMAIN}_access_log combined
ErrorLog logs/${PRIMARY_DOMAIN}_error_log
ScriptAlias /cgi-bin/ /w3/${PRIMARY_DOMAIN}/cgi-bin/
<Directory /w3/${PRIMARY_DOMAIN}/cgi-bin>
...
</Directory>
</VirtualHost>
Welcome to WebmasterWorld!
Most Apache configuration directives have no provisions for dereferencing variables.
Large hosts typically use a shell script to generate the configuration (httpd.conf) file, or 'extended' VPS configuration files such as conf.d, for new domains as they are added. Perhaps this approach would be workable for your needs.
Each Apache directive description starts with a list of the directive's syntax, execution context, core status, and module name. The syntax description should be your guide as to whether the directive can accept variables.
Jim
For the logging, I guess you can use split-logfile,
[httpd.apache.org...]
Or use pipe for CustomLog.
[httpd.apache.org...]
If you search, you may find more solutions, like this.
[logtomysql.sourceforge.net...]
[serverwatch.com...]