Commit 7808708d authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Tristan Cavelier

Log apache zope services in custom files with remote_user info

parent a6228380
...@@ -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
...@@ -83,7 +83,7 @@ filename = instance-zope.cfg.in ...@@ -83,7 +83,7 @@ filename = instance-zope.cfg.in
[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