Per-user vhost logging

Posted by kojiro on Server Fault See other posts from Server Fault or by kojiro
Published on 2012-10-23T16:01:01Z Indexed on 2012/10/23 17:05 UTC
Read the original article Hit count: 190

Filed under:
|
|

I have a working per-user virtual host configuration with Apache, but I would like each user to have access to the logs for his virtual hosts. Obviously the ErrorLog and CustomLog directives don't accept the wildcard syntax that VirtualDocumentRoot does, but is there a way to achieve logs in each user's directory?

<VirtualHost *:80>
    ServerName *.example.com
    ServerAdmin [email protected]
    VirtualDocumentRoot /home/%2/projects/%1
    <Directory /home/*/projects/>
        Options FollowSymlinks Indexes
        IndexOptions FancyIndexing FoldersFirst
        AllowOverride All
        Order Allow,Deny
        Allow From All
        Satisfy Any
    </Directory>

    Alias /favicon.ico /var/www/default/favicon.ico
    Alias /robots.txt /var/www/default/robots.txt

    LogLevel warn
    # ErrorLog /home/%2/logs/%1.error.log
    # CustomLog /home/%2/logs/%1.access.log combined
</VirtualHost>

© Server Fault or respective owner

Related posts about apache2

Related posts about logging