Commit 9e49e48c authored by Alain Takoudjou's avatar Alain Takoudjou

Log apache zope services in custom files with remote_user info

parent 46d466fe
...@@ -47,7 +47,7 @@ RequestHeader unset REMOTE_USER ...@@ -47,7 +47,7 @@ RequestHeader unset REMOTE_USER
ErrorLog "{{ parameter_dict['error-log'] }}" ErrorLog "{{ parameter_dict['error-log'] }}"
# Default apache log format with request time in microsecond at the end # Default apache log format with request time in microsecond at the end
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined LogFormat "%h %l %{REMOTE_USER}i %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined
CustomLog "{{ parameter_dict['access-log'] }}" combined CustomLog "{{ parameter_dict['access-log'] }}" combined
<Directory /> <Directory />
...@@ -57,7 +57,7 @@ CustomLog "{{ parameter_dict['access-log'] }}" combined ...@@ -57,7 +57,7 @@ CustomLog "{{ parameter_dict['access-log'] }}" combined
</Directory> </Directory>
RewriteEngine On RewriteEngine On
{% for port, _, backend, authentication in parameter_dict['backend-list'] -%} {% for family_name, (port, _, backend, authentication) in parameter_dict['backend-list'].items() -%}
{% for ip in parameter_dict['ip-list'] -%} {% for ip in parameter_dict['ip-list'] -%}
Listen {{ ip }}:{{ port }} Listen {{ ip }}:{{ port }}
{% endfor -%} {% endfor -%}
...@@ -67,6 +67,9 @@ Listen {{ ip }}:{{ port }} ...@@ -67,6 +67,9 @@ Listen {{ ip }}:{{ port }}
RequestHeader set REMOTE_USER %{SSL_CLIENT_S_DN_CN}s RequestHeader set REMOTE_USER %{SSL_CLIENT_S_DN_CN}s
SSLCACertificateFile {{ parameter_dict['ca-cert'] }} SSLCACertificateFile {{ parameter_dict['ca-cert'] }}
SSLCARevocationPath {{ parameter_dict['crl'] }} SSLCARevocationPath {{ parameter_dict['crl'] }}
ErrorLog "{{ parameter_dict['log-dir'] }}/apache-{{ family_name }}-error.log"
CustomLog "{{ parameter_dict['log-dir'] }}/apache-{{ family_name }}-access.log" combined
{% endif -%} {% endif -%}
SSLEngine on SSLEngine on
RewriteRule ^/(.*) {{ backend }}/$1 [L,P] RewriteRule ^/(.*) {{ backend }}/$1 [L,P]
......
...@@ -103,11 +103,12 @@ ca-cert = ${directory:apache-conf}/ca.crt ...@@ -103,11 +103,12 @@ ca-cert = ${directory:apache-conf}/ca.crt
crl = ${directory:apache-conf}/crl.pem crl = ${directory:apache-conf}/crl.pem
[apache-conf-parameter-dict] [apache-conf-parameter-dict]
backend-list = {{ dumps(apache_dict.values()) }} backend-list = {{ dumps(apache_dict) }}
ip-list = {{ dumps(apache_ip_list) }} ip-list = {{ dumps(apache_ip_list) }}
pid-file = ${directory:run}/apache.pid pid-file = ${directory:run}/apache.pid
error-log = ${directory:log}/apache-error.log error-log = ${directory:log}/apache-error.log
access-log = ${directory:log}/apache-access.log access-log = ${directory:log}/apache-access.log
log-dir = ${directory:log}
# Apache 2.4's default value (60 seconds) can be a bit too short # Apache 2.4's default value (60 seconds) can be a bit too short
timeout = 300 timeout = 300
# Basic SSL server configuration # Basic SSL server configuration
......
...@@ -25,7 +25,7 @@ repository_id_list = erp5 vifib/master ...@@ -25,7 +25,7 @@ repository_id_list = erp5 vifib/master
[erp5] [erp5]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/erp5.git repository = http://git.erp5.org/repos/erp5.git
branch = erp5-slapos-upgrade branch = erp5-vifib
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
[vifib] [vifib]
...@@ -35,7 +35,7 @@ branch = master ...@@ -35,7 +35,7 @@ branch = master
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
[slapos.cookbook-repository] [slapos.cookbook-repository]
branch = erp5-cluster branch = slapos-master-cluster
[vifib-fix-products-paths] [vifib-fix-products-paths]
recipe = plone.recipe.command recipe = plone.recipe.command
...@@ -73,7 +73,7 @@ md5sum = e75f791c031f042629858e7442d06964 ...@@ -73,7 +73,7 @@ md5sum = e75f791c031f042629858e7442d06964
[template-balancer] [template-balancer]
< = download-base-part < = download-base-part
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = 3f23b1a69304cbf142e61bbdb561686a md5sum = 894e93c41952f7abc6ecba1088e9e4af
[template-zope] [template-zope]
< = download-base-part < = download-base-part
...@@ -83,7 +83,7 @@ md5sum = 65bfa6ceaa4edcf90297e2ee0bf42032 ...@@ -83,7 +83,7 @@ md5sum = 65bfa6ceaa4edcf90297e2ee0bf42032
[template-apache-conf] [template-apache-conf]
< = download-base-part < = download-base-part
filename = apache.conf.in filename = apache.conf.in
md5sum = bb329fc28bef095a01efc901d2f84149 md5sum = 234f9f5559b456d7928d64415a3203be
[template-create-erp5-site-real] [template-create-erp5-site-real]
< = download-base-part < = download-base-part
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment