SBNservices
IS-IT--Management
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. The machine is OpenSuse 10.2
Here is my config:
apache2/conf.d/vhosts.conf
apache2/vhosts.d/vhosts.conf
<VirtualHost DocumentRoot /srv/ ServerName ServerAdmin <Directory /srv/ AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.php
</Directory>
ScriptAlias /cgi-bin/ /srv/ <Directory /srv/ AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost DocumentRoot /srv/ ServerName ServerAdmin admin@my-domain2.com
<Directory /srv/ AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.php
</Directory>
ScriptAlias /cgi-bin/ /srv/ <Directory /srv/ AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
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. The machine is OpenSuse 10.2
Here is my config:
apache2/conf.d/vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster@my-domain1.com
DocumentRoot /srv/ ServerName ServerAlias ErrorLog /var/log/apache2/ CustomLog /var/log/apache2/ common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@my-domain2.com
DocumentRoot /srv/ ServerName ServerAlias ErrorLog /var/log/apache2/ CustomLog /var/log/apache2/ common
</VirtualHost>
ServerAdmin webmaster@my-domain1.com
DocumentRoot /srv/ ServerName ServerAlias ErrorLog /var/log/apache2/ CustomLog /var/log/apache2/ common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@my-domain2.com
DocumentRoot /srv/ ServerName ServerAlias ErrorLog /var/log/apache2/ CustomLog /var/log/apache2/ common
</VirtualHost>
apache2/vhosts.d/vhosts.conf
<VirtualHost DocumentRoot /srv/ ServerName ServerAdmin <Directory /srv/ AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.php
</Directory>
ScriptAlias /cgi-bin/ /srv/ <Directory /srv/ AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost DocumentRoot /srv/ ServerName ServerAdmin admin@my-domain2.com
<Directory /srv/ AllowOverride None
Order allow,deny
Allow from all
DirectoryIndex index.php
</Directory>
ScriptAlias /cgi-bin/ /srv/ <Directory /srv/ AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
</VirtualHost>