0

I have a conf like this

<VirtualHost *:80>
    VirtualDocumentRoot /Users/molfar/Sites/%-2+
</VirtualHost>

I'd like to dynamically set error and access logs paths. I tried the following

<VirtualHost *:80>
    VirtualDocumentRoot /Users/molfar/Sites/%-2+
    ErrorLog "/private/var/log/apache2/%-2+_error.log"
    CustomLog "/private/var/log/apache2/%-2+_access.log" common
</VirtualHost>

But placeholders doesn't work in ErrorLog and CustomLog directives. Are there any other placeholders?

2 Answers 2

1

No - the special substitutions that VirtualDocumentRoot uses are not available to other directives. You can't split the files in this way if you're using VirtualDocumentRoot.

Instead, maybe modify your log format to include the requested host so that you're able to differentiate the requests to different host names?

1

Checkout split-logfile - it is included in every Apache package.

http://httpd.apache.org/docs/2.2/programs/other.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .