library/roles/tomcat-multiple-instances, library/roles/tomcat: Record the remote client IP address into the access log. See https://support.d4science.org/issues/9155

This commit is contained in:
Andrea Dell'Amico 2017-07-04 17:24:23 +02:00
parent d7db253dd8
commit 848b7c94d9
4 changed files with 13 additions and 2 deletions

View File

@ -37,6 +37,7 @@ tomcat_m_webapps_unpack: False
tomcat_m_start_instances: True
tomcat_m_enable_instances: True
tomcat_m_jndi_pool: False
tomcat_m_direct_access: False
# JMX and debugging
tomcat_m_enable_remote_debugging: False

View File

@ -105,8 +105,13 @@
Note: The pattern used is equivalent to using pattern="combined" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access." suffix="log"
{% if tomcat_m_direct_access %}
pattern="combined"
rotatable="False"
{% else %}
pattern="%t %{org.apache.catalina.AccessLog.RemoteAddr}r %{X-AUSERNAME}o %I %s &quot;%r&quot; %b %{User-Agent}i"
{% endif %}
rotatable="False"
/>
{% endif %}
</Host>

View File

@ -28,6 +28,7 @@ tomcat_webapps_unpack: False
tomcat_ajp_enabled: False
tomcat_ajp_port: 8009
tomcat_ajp_address: 127.0.0.1
tomcat_direct_access: False
# There is a bug that kills tomcat after 50 days if the shutdown port is enabled
# Disable the shutdown port by default
#tomcat_shutdown_port: 8005

View File

@ -149,8 +149,12 @@
Note: The pattern used is equivalent to using pattern="combined" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access." suffix="log"
{% if tomcat_direct_access %}
pattern="combined"
rotatable="False"
{% else %}
pattern="%t %{org.apache.catalina.AccessLog.RemoteAddr}r %{X-AUSERNAME}o %I %s &quot;%r&quot; %b %{User-Agent}i"
rotatable="False"
{% endif %}
/>
{% endif %}
</Host>