ansible-zabbix/zabbix-server/templates/apache_vhost.conf.j2
2017-01-17 17:59:08 +01:00

55 lines
1.4 KiB
Django/Jinja

<VirtualHost *:80>
ServerName {{ zabbix_url }}
ServerAlias {{ apachectl_version.stdout }}
{% for alias in zabbix_url_aliases %}
ServerAlias {{ alias }}
{% endfor %}
## Vhost docroot
DocumentRoot "/usr/share/zabbix"
{% set directory_paths = ['/usr/share/zabbix/conf', '/usr/share/zabbix/api', '/usr/share/zabbix/include', '/usr/share/zabbix/include/classes'] %}
<Directory "/usr/share/zabbix">
{% if apache_version|string() == '2.4' %}
Options FollowSymLinks
AllowOverride None
Require all granted
{% else %}
AllowOverride None
Order Allow,Deny
Allow from all
{% endif %}
</Directory>
{% for my_path in directory_paths %}
<Directory "{{ my_path }}">
{% if apache_version|string() == '2.4' %}
Require all granted
{% else %}
AllowOverride None
Order Deny,Allow
Deny from all
{% endif %}
</Directory>
{% endfor %}
## Logging
ErrorLog "/var/log/{{ apache_log }}/{{ zabbix_url }}_error.log"
ServerSignature Off
CustomLog "/var/log/{{ apache_log }}/{{ zabbix_url }}_access.log" combined
## Rewrite rules
RewriteEngine On
RewriteRule ^$ /index.php [L]
## Custom fragment
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
# Set correct timezone.
php_value date.timezone {{ zabbix_timezone }}
</VirtualHost>