2

I've got my vhosts conf setup to automate all websites inside my www dir using the following

<VirtualHost *:80>
    ServerAdmin webmaster@%0
    ServerName %0
    ServerAlias %0
    VirtualDocumentRoot C:/wamp/www/%0/httpdocs
</VirtualHost>

This all works absolutely fine, however I want to add a custom log directory using the %0 variable. I tried doing

<VirtualHost *:80>
    ServerAdmin webmaster@%0
    ServerName %0
    ServerAlias %0
    VirtualDocumentRoot C:/wamp/www/%0/httpdocs
    ErrorLog C:/wamp/www/%0/logs/errors.log
    CustomLog C:/wamp/www/%0/logs/access.log common
</VirtualHost>

However this doesnt work, apache errors when starting up saying

(OS 3)The system cannot find the path specified.  : httpd.exe: could not open error log file C:/wamp/www/%0/logs/errors.log.

How can I adjust the vhost entry to allow this method of logging?

Thanks

owenmelbz
  • 6,180
  • 16
  • 63
  • 113

1 Answers1

0

Maybe mod_macro could be something for this? I did not try it myself since I do not have that module installed (Third party) but this post from serverfault might be of interest?

Using variables in Apache config files to reduce duplication?

Community
  • 1
  • 1
Qben
  • 2,617
  • 2
  • 24
  • 36