I am attempting to make a wildcard VirtualHost conf file for apache2, and I am undecided the way to deal with the
CustomLog settings to place the logs the place I would like them to go. As you may see within the second
VirtualHost, I’ve the logs in a
logs folder within the domains
DocumentRoot. This works advantageous for static
VirtualHosts, however how would I’m going about it for a wildcard
VirtualHost. eg, the primary
NameVirtualHost *:80 # Wild card all subdomains <VirtualHost *:80> ServerAlias *.instance.com VirtualDocumentRoot /var/www/%0/public ErrorLog ????? CustomLog ????? mixed </VirtualHost> # Predominant area <VirtualHost *:80> ServerName instance.com ServerAlias www.instance.com DocumentRoot /var/www/instance.com/public ErrorLog /var/www/instance.com/logs/error.log CustomLog /var/www/instance.com/logs/entry.log mixed </VirtualHost>
I’ve tried going
ErrorLog /var/www/*.instance.com/logs/error.log and
ErrorLog /var/www/%0/logs/error.log and the identical for
CustomLog, however when I attempt to restart apache it throws an error.
What syntax ought to I take advantage of to get a working model of my
ErrorLog instance above?
I’ve seen Wildcards in Digital Hosts with dynamic logs? , however it isn’t actually what I’m after because it nonetheless finally ends up placing all of the logs into one huge file somewhat than having them break up into their very own subdomain particular folders.