Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
slapos
Commits
98267686
Commit
98267686
authored
Jan 13, 2015
by
Alain Takoudjou
Committed by
Tristan Cavelier
Mar 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos-master: Apachedex can now analyse apache access logs.
parent
645813c3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
1 deletion
+95
-1
software/slapos-master/instance-balancer.cfg.in
software/slapos-master/instance-balancer.cfg.in
+90
-0
software/slapos-master/instance-erp5.cfg.in
software/slapos-master/instance-erp5.cfg.in
+4
-1
stack/erp5/instance.cfg.in
stack/erp5/instance.cfg.in
+1
-0
No files found.
software/slapos-master/instance-balancer.cfg.in
View file @
98267686
...
@@ -16,6 +16,10 @@ per partition. No more (undefined result), no less (IndexError).
...
@@ -16,6 +16,10 @@ per partition. No more (undefined result), no less (IndexError).
{% set ipv6 = (ipv6_set | list)[0] -%}
{% set ipv6 = (ipv6_set | list)[0] -%}
{% do apache_ip_list.append('[' ~ ipv6 ~ ']') -%}
{% do apache_ip_list.append('[' ~ ipv6 ~ ']') -%}
{% endif -%}
{% endif -%}
{% set monitor = slapparameter_dict['monitor'] -%}
{% if monitor -%}
{% set monitor_port = slapparameter_dict['monitor-port'] %}
{% endif -%}
{% if use_ipv6 -%}
{% if use_ipv6 -%}
[zope-tunnel-base]
[zope-tunnel-base]
...
@@ -149,6 +153,9 @@ recipe = slapos.cookbook:publish.serialised
...
@@ -149,6 +153,9 @@ recipe = slapos.cookbook:publish.serialised
{{ family_name ~ '-v6' }} = {% if ipv6_set %}{{ scheme ~ '://[' ~ ipv6 ~ ']:' ~ apache_port }}{% endif %}
{{ family_name ~ '-v6' }} = {% if ipv6_set %}{{ scheme ~ '://[' ~ ipv6 ~ ']:' ~ apache_port }}{% endif %}
{{ family_name }} = {{ scheme ~ '://' ~ ipv4 ~ ':' ~ apache_port }}
{{ family_name }} = {{ scheme ~ '://' ~ ipv4 ~ ':' ~ apache_port }}
{% endfor -%}
{% endfor -%}
{% if monitor -%}
monitor-url = ${monitor-parameters:url}
{% endif -%}
[apache-ssl]
[apache-ssl]
recipe = plone.recipe.command
recipe = plone.recipe.command
...
@@ -156,10 +163,12 @@ command = "{{ parameter_dict['openssl'] }}/bin/openssl" req -newkey rsa -batch -
...
@@ -156,10 +163,12 @@ command = "{{ parameter_dict['openssl'] }}/bin/openssl" req -newkey rsa -batch -
key = ${apache-conf-ssl:key}
key = ${apache-conf-ssl:key}
cert = ${apache-conf-ssl:cert}
cert = ${apache-conf-ssl:cert}
{% set apache_service_log_list = {} -%}
{% for family_name, (_, _, _, authentication) in apache_dict.items() -%}
{% for family_name, (_, _, _, authentication) in apache_dict.items() -%}
{% if authentication -%}
{% if authentication -%}
{% set base_name = 'apache-' ~ family_name -%}
{% set base_name = 'apache-' ~ family_name -%}
{% do part_list.append('logrotate-' ~ base_name) -%}
{% do part_list.append('logrotate-' ~ base_name) -%}
{% do apache_service_log_list.__setitem__(family_name, base_name) -%}
[logrotate-{{ base_name }}]
[logrotate-{{ base_name }}]
recipe = slapos.cookbook:logrotate.d
recipe = slapos.cookbook:logrotate.d
logrotate-entries = ${logrotate:logrotate-entries}
logrotate-entries = ${logrotate:logrotate-entries}
...
@@ -178,6 +187,69 @@ name = apache
...
@@ -178,6 +187,69 @@ name = apache
log = ${apache-conf-parameter-dict:error-log} ${apache-conf-parameter-dict:access-log}
log = ${apache-conf-parameter-dict:error-log} ${apache-conf-parameter-dict:access-log}
post = {{ parameter_dict['bin-directory'] }}/slapos-kill --pidfile ${apache-conf-parameter-dict:pid-file} -s USR1
post = {{ parameter_dict['bin-directory'] }}/slapos-kill --pidfile ${apache-conf-parameter-dict:pid-file} -s USR1
{% if monitor -%}
[{{ section('monitor-current-log-access') }}]
< = monitor-directory-access
source = ${directory:log}
[{{ section('monitor-backup-log-access') }}]
< = monitor-directory-access
source = ${logrotate:backup}
[{{ section('monitor-apachedex-access') }}]
< = monitor-directory-access
source = ${monitor-directory:apachedex-result}
[monitor-parameters]
port = {{ slapparameter_dict['monitor-port'] }}
[apachedex-erp5-entries]
<= apachedex-entries-base
script-name = apachedex-erp5
extra-context =
section parameter_dict apachedex-erp5-parameters
key name :script-name
# XXX - Hard coded values for slapos and vifib.
[apachedex-erp5-parameters]
apache-log-list = ${logrotate:backup}/apache-access.log-%(date)s.gz
base-list =
'+slapos.vifib.com' '/VirtualHostBase/https/slapos\.vifib\.com:443/erp5/web_site_module/commercial/VirtualHostRoot(/|$|\?)'
'+www.slapos.org' '/VirtualHostBase/https/www\.slapos\.org:443/erp5/web_site_module/hosting/VirtualHostRoot(/|$|\?)'
erp5-base-list =
'+vifib.erp5.net' '/VirtualHostBase/https/vifib\.erp5\.net:443/erp5/VirtualHostRoot(/|$|\?)'
skip-base-list =
[{{ section('cron-entry-apachedex-erp5') }}]
<= cron
recipe = slapos.cookbook:cron.d
name = ${apachedex-erp5-entries:script-name}
frequency = 0 3 * * *
command = ${apachedex-erp5-entries:rendered}
{% for family_name, log_name in apache_service_log_list.items() -%}
[apachedex-{{ family_name }}-entries]
<= apachedex-entries-base
script-name = apachedex-{{ family_name }}
extra-context =
section parameter_dict apachedex-{{ family_name }}-parameters
key name :script-name
[apachedex-{{ family_name }}-parameters]
apache-log-list = ${logrotate:backup}/{{ log_name }}-access.log-%(date)s.gz
base-list =
erp5-base-list =
skip-base-list =
[{{ section('cron-entry-apachedex-' ~ family_name) }}]
<= cron
recipe = slapos.cookbook:cron.d
name = apachedex-{{ family_name }}
frequency = 0 3 * * *
command = ${apachedex-{{ family_name }}-entries:rendered}
{% endfor -%}
{% endif -%}
[directory]
[directory]
recipe = slapos.cookbook:mkdirectory
recipe = slapos.cookbook:mkdirectory
apache-conf = ${:etc}/apache
apache-conf = ${:etc}/apache
...
@@ -191,7 +263,25 @@ log = ${:var}/log
...
@@ -191,7 +263,25 @@ log = ${:var}/log
[buildout]
[buildout]
extends = {{ logrotate_cfg }}
extends = {{ logrotate_cfg }}
{% if monitor -%}
# Extends template for monitor
{{ parameter_dict['template-monitor'] }}
{% endif -%}
parts +=
parts +=
publish
publish
logrotate-apache
logrotate-apache
{% if monitor -%}
# Access to zope logs
certificate-authority
cron-entry-monitor
cron-entry-rss
deploy-index
setup-static-files
public-symlink
cgi-httpd-wrapper
cgi-httpd-graceful-wrapper
monitor-promise
monitor-instance-log-access
{% endif -%}
# Complete parts with sections
{{ part_list | join('\n ') }}
{{ part_list | join('\n ') }}
software/slapos-master/instance-erp5.cfg.in
View file @
98267686
...
@@ -7,9 +7,10 @@
...
@@ -7,9 +7,10 @@
{% set mariadb_request_dict = {'tcpv4-port': mariadb_dict.get('tcpv4-port', 2099)} -%}
{% set mariadb_request_dict = {'tcpv4-port': mariadb_dict.get('tcpv4-port', 2099)} -%}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
{% set monitor_dict = slapparameter_dict.get('monitor', {}) %}
{% set monitor_port = monitor_dict.get('port-base', 2600) %}
{% set monitor_port = monitor_dict.get('port-base', 2600) %}
{% set monitor_count = 1 -%}
{% if mariadb_dict.get('monitor', False) -%}
{% if mariadb_dict.get('monitor', False) -%}
{% do mariadb_request_dict.__setitem__('monitor-port', mariadb_dict.get('monitor-port', monitor_port)) -%}
{% do mariadb_request_dict.__setitem__('monitor-port', mariadb_dict.get('monitor-port', monitor_port)) -%}
{% set monitor_count = 2 -%}
{% set monitor_port_balancer = monitor_port + 1 -%}
{% endif -%}
{% endif -%}
[request-common]
[request-common]
...
@@ -214,6 +215,8 @@ config-{{ name }} = {{ ' ${' ~ zope_section_id ~ ':connection-zope-address-list}
...
@@ -214,6 +215,8 @@ config-{{ name }} = {{ ' ${' ~ zope_section_id ~ ':connection-zope-address-list}
config-haproxy-server-check-path = {{ dumps(balancer_dict.get('haproxy-server-check-path', '/') % {'site-id': site_id}) }}
config-haproxy-server-check-path = {{ dumps(balancer_dict.get('haproxy-server-check-path', '/') % {'site-id': site_id}) }}
config-ssl = {{ dumps(balancer_dict.get('ssl', {})) }}
config-ssl = {{ dumps(balancer_dict.get('ssl', {})) }}
config-certificate-authority-path = ${directory:ca-dir}
config-certificate-authority-path = ${directory:ca-dir}
config-monitor = {{ dumps(slapparameter_dict.get('monitoring', True)) }}
config-monitor-port = {{ monitor_port_balancer }}
[request-frontend-base]
[request-frontend-base]
{% if has_frontend -%}
{% if has_frontend -%}
...
...
stack/erp5/instance.cfg.in
View file @
98267686
...
@@ -84,6 +84,7 @@ bin-directory = {{ bin_directory }}
...
@@ -84,6 +84,7 @@ bin-directory = {{ bin_directory }}
dash = {{ dash_location }}
dash = {{ dash_location }}
template-haproxy-cfg = {{ template_haproxy_cfg }}
template-haproxy-cfg = {{ template_haproxy_cfg }}
template-apache-conf = {{ template_apache_conf }}
template-apache-conf = {{ template_apache_conf }}
template-monitor = {{ template_monitor }}
[dynamic-template-balancer]
[dynamic-template-balancer]
< = jinja2-template-base
< = jinja2-template-base
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment