I have been trying to set up Apache to log to individual files for each virtual host. Either I get Apache to run without separate logs, or Apache fails to load. I have tried just about everything, but nothing seems to work.
With the config I have below, I am now able to get vhosts working, just not logging the way I want it. I get get to each website no problem. Problem may be that I was using both Yast to initially set up vhosts, while also reading the docs on Apache's site which confused me more. At the moment, the log file will be created, just no data is inserted. Everything is still going to var/log/apache2/access_log
Here is my config:
apache2/conf.d/vhosts.conf<VirtualHost *:80>
ServerAdmin webmaster@my-domain1.com
DocumentRoot /srv/www/htdocs/
ServerName www.my-domain1.com
ServerAlias www.my-domain1.com
ErrorLog /var/log/apache2/www.my-domain1.com-error_log
CustomLog /var/log/apache2/www.my-domain1.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@my-domain2.com
DocumentRoot /srv/www/htdocs/my-domain2
ServerName www.my-domain2.com
ServerAlias www.my-domain2.com
ErrorLog /var/log/apache2/www.my-domain2.com-error_log
CustomLog /var/log/apache2/www.my-domain2.com-access_log common
</VirtualHost>
apache2/vhosts.d/vhosts.conf
<VirtualHost www.my-domain1.com>
DocumentRoot /srv/www/htdocs
ServerName
www.my-domain1.com
ServerAdmin
www.my-domain1.com
<Directory /srv/www/htdocs>
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.php
</Directory>
ScriptAlias /cgi-bin/ /srv/www/cgi-bin
<Directory /srv/www/cgi-bin>
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost www.my-domain2.com>
DocumentRoot /srv/www/htdocs/crm
ServerName
www.my-domain2.com
ServerAdmin
admin@my-domain2.com
<Directory /srv/www/htdocs/my-domain2>
AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.php
</Directory>
ScriptAlias /cgi-bin/ /srv/www/cgi-bin
<Directory /srv/www/cgi-bin>
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>