Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I suggest not using NFS for logging as it can be a real performance killer. Instead use rsyslog with remote logging enabled. In you <code>apache2.conf</code> you can setup a LogFormat that includes the VirtualHost name and then pipe the log to rsyslog telling it to write the output to a remote host.</p> <p>In apache2.conf:<br></p> <pre><code>LogFormat "%v %{X-FORWARDED-FOR}i %t \"%r\" %&gt;s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined CustomLog "|/usr/bin/logger -t apache2 -p local7.info" vhost_combined </code></pre> <p>In rsyslog.conf on the webserver:<br></p> <pre><code>local7.* @&lt;remote host ip&gt; </code></pre> <p>In rsyslog.conf on the remote host:<br></p> <pre><code>local7.* /var/log/webfrontends.log;precise </code></pre> <p>As for the Apache configuration files, we use NFS.<br> <code>apache2.conf</code> is a link to a remote file (different files for different machines if needed) and in <code>apache2.conf</code> we use an <code>Include</code> directive to read specific site configurations (different dirs for different machines if needed)</p> <p>on the NFS server the NFS exported dir <code>/NFS_EXPORT/etc/apache2/</code> contains:<br></p> <pre><code> - webserver1_apache2.conf - webserver2_apache2.conf - webserver1_vhosts (dir) - webserver2_vhosts (dir) </code></pre> <p>Both <code>webserver1_apache2.conf</code> and <code>webserver2_apache2.conf</code> contain <code>Include "/etc/apache2/vhosts"</code></p> <p>on WebServer 1<br></p> <pre><code>ln -s /NFS_EXPORT/etc/apache2/webserver1_apache2.conf /etc/apache2/apache2.conf ln -s /NFS_EXPORT/etc/apache2/webserver1_vhosts/ /etc/apache2/vhosts </code></pre> <p>on WebServer 2<br></p> <pre><code>ln -s /NFS_EXPORT/etc/apache2/webserver2_apache2.conf /etc/apache2/apache2.conf ln -s /NFS_EXPORT/etc/apache2/webserver2_vhosts/ /etc/apache2/vhosts </code></pre> <p>If all your webservers are the same in terms of hardware specs and serve the same sites/applications then there is no need to differentiate the configs.</p> <p>Of course you will need a script or some other mechanism to restart apache on all your server once you modify a configuration. Also, upgrading your apache2 software can be tricky unless you have root access to your NFS exports beacause typically your package management system will complain about not being able to modify some configuration file.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload