cookbook-zabbix/templates/apache/zabbix-mod.conf.erb

82 lines
2.2 KiB
Text
Raw Permalink Normal View History

<% if node['apache']['version'] != '2.4' -%>
NameVirtualHost *:<%= @params[:server_port] %>
<% end -%>
<VirtualHost *:<%= @params[:server_port] %>>
ServerName <%= @params[:server_name] %>
<% if @params[:server_aliases] -%>
ServerAlias <%= @params[:server_aliases].join " " %>
<% end -%>
DocumentRoot <%= @params[:docroot] %>
# The following lines prevent .user.ini files from being viewed by Web clients.
<Files ".user.ini">
Require all denied
</Files>
# Allow php to handle Multiviews.
AddType text/html .php
<IfModule mod_php5.c>
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
php_value always_populate_raw_post_data -1
</IfModule>
<Directory <%= @params[:docroot] %>>
Options <%= [@params[:directory_options] || "FollowSymLinks" ].flatten.join " " %>
AllowOverride <%= [@params[:allow_override] || "None" ].flatten.join " " %>
<% if node['apache']['version'] == '2.4' -%>
Require all granted
<% else -%>
Order allow,deny
Allow from all
<% end -%>
</Directory>
<Directory <%= @params[:docroot] %>/conf>
<% if node['apache']['version'] == '2.4' -%>
Require all denied
<% else -%>
Order deny,allow
Deny from all
<% end -%>
</Directory>
<Directory <%= @params[:docroot] %>/app>
<% if node['apache']['version'] == '2.4' -%>
Require all denied
<% else -%>
Order deny,allow
Deny from all
<% end -%>
</Directory>
<Directory <%= @params[:docroot] %>/include>
<% if node['apache']['version'] == '2.4' -%>
Require all denied
<% else -%>
Order deny,allow
Deny from all
<% end -%>
</Directory>
<Directory <%= @params[:docroot] %>/local>
<% if node['apache']['version'] == '2.4' -%>
Require all denied
<% else -%>
Order deny,allow
Deny from all
<% end -%>
</Directory>
ErrorLog <%= node['apache']['log_dir'] %>/<%= @params[:name] %>-error.log
CustomLog <%= node['apache']['log_dir'] %>/<%= @params[:name] %>-access.log combined
<% if @params[:directory_index] -%>
DirectoryIndex <%= [@params[:directory_index]].flatten.join " " %>
<% end -%>
</VirtualHost>