这是我目前的vhost:
<VirtualHost *:80>
UseCanonicalName Off
VirtualDocumentRoot /var/www/%0/public
<Directory /var/www/%0/public>
Options Indexes FollowSymLinks Includes ExecCGI
DirectoryIndex index.php index.html
AllowOverride All
Order allow,deny
Allow from all
</Directory
</VirtualHost>
如何为每个%0 vhost获取access.log?
仅供参考。如果重要,这是debian安装。
答案 0 :(得分:1)
您可以在VirtualHost定义中添加TransferLog。更改配置时,请不要忘记重新启动Apache服务。
<VirtualHost *:80>
UseCanonicalName Off
VirtualDocumentRoot /var/www/%0/public
ErrorLog/var/logs/%0/error.log
TransferLog /var/logs/%0/access.log
<Directory /var/www/%0/public>
Options Indexes FollowSymLinks Includes ExecCGI
DirectoryIndex index.php index.html
AllowOverride All
Order allow,deny
Allow from all
</Director>
</VirtualHost>