From 4e23de6bcda3344649e2a1a5ee6d0e4296eaecd1 Mon Sep 17 00:00:00 2001 From: Dmitry Teselkin Date: Fri, 31 Oct 2014 09:25:09 +0300 Subject: [PATCH] Fix vhost configuration sections According to https://wiki.apache.org/httpd/CommonMisconfigurations is is wrong to specify server name in opening tag. ServerName should be used instead. Indentations also fixed in some files. Change-Id: Id9d20a672103221efa01be61a174b62706036e57 --- templates/kibana.vhost.erb | 50 ++++++++++++++++++------------------ templates/logstash.vhost.erb | 16 ++++++------ 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/templates/kibana.vhost.erb b/templates/kibana.vhost.erb index a14cd3c..786f358 100644 --- a/templates/kibana.vhost.erb +++ b/templates/kibana.vhost.erb @@ -1,31 +1,31 @@ -:80> - ServerName <%= scope.lookupvar("::logstash::web::vhost_name") %> - ServerAdmin <%= scope.lookupvar("::logstash::web::serveradmin") %> + + ServerName <%= scope.lookupvar("::logstash::web::vhost_name") %> + ServerAdmin <%= scope.lookupvar("::logstash::web::serveradmin") %> - ErrorLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::logstash::web::vhost_name") %>-error.log + ErrorLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::logstash::web::vhost_name") %>-error.log - LogLevel warn + LogLevel warn - CustomLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::logstash::web::vhost_name") %>-access.log combined + CustomLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::logstash::web::vhost_name") %>-access.log combined - - <% if @proxy_elasticsearch == true %> - # Proxy GETs for elasticsearch .*/_aliases, .*/_status, .*/_search, - # .*/_mapping, .*/_mapping/field/.*, _cluster/health, and _nodes. - RewriteEngine on - RewriteCond %{REQUEST_METHOD} GET - RewriteRule ^/elasticsearch/((.*/)?_aliases|(.*/)?_status|(.*/)?_search|(.*/)?_mapping|(.*/)?_mapping/field/(.*)?|_cluster/health|_nodes)$ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/$1 [P] - RewriteCond %{REQUEST_METHOD} POST - RewriteRule ^/elasticsearch/(_aliases|(.*/)?_search)$ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/$1 [P] - RewriteCond %{REQUEST_METHOD} OPTIONS - RewriteRule ^/elasticsearch/((.*/)?_search)$ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/$1 [P] - /> - ProxySet connectiontimeout=15 timeout=120 - - ProxyPassReverse /elasticsearch/ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/ - <% end %> + + <% if @proxy_elasticsearch == true %> + # Proxy GETs for elasticsearch .*/_aliases, .*/_status, .*/_search, + # .*/_mapping, .*/_mapping/field/.*, _cluster/health, and _nodes. + RewriteEngine on + RewriteCond %{REQUEST_METHOD} GET + RewriteRule ^/elasticsearch/((.*/)?_aliases|(.*/)?_status|(.*/)?_search|(.*/)?_mapping|(.*/)?_mapping/field/(.*)?|_cluster/health|_nodes)$ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/$1 [P] + RewriteCond %{REQUEST_METHOD} POST + RewriteRule ^/elasticsearch/(_aliases|(.*/)?_search)$ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/$1 [P] + RewriteCond %{REQUEST_METHOD} OPTIONS + RewriteRule ^/elasticsearch/((.*/)?_search)$ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/$1 [P] + /> + ProxySet connectiontimeout=15 timeout=120 + + ProxyPassReverse /elasticsearch/ http://<%= scope.lookupvar("::logstash::web::discover_nodes")[0] %>/ + <% end %> - ProxyPass / http://127.0.0.1:5601/ retry=0 - ProxyPassReverse / http://127.0.0.1:5601/ - + ProxyPass / http://127.0.0.1:5601/ retry=0 + ProxyPassReverse / http://127.0.0.1:5601/ + diff --git a/templates/logstash.vhost.erb b/templates/logstash.vhost.erb index ef73a6a..345c649 100644 --- a/templates/logstash.vhost.erb +++ b/templates/logstash.vhost.erb @@ -1,13 +1,13 @@ -:80> - ServerName <%= @vhost_name %> - ServerAdmin <%= @serveradmin %> + + ServerName <%= @vhost_name %> + ServerAdmin <%= @serveradmin %> - ErrorLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-error.log + ErrorLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-error.log - LogLevel warn + LogLevel warn - CustomLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-access.log combined + CustomLog ${APACHE_LOG_DIR}/<%= @vhost_name %>-access.log combined - ProxyPass / http://127.0.0.1:9292/ retry=0 - ProxyPassReverse / http://127.0.0.1:9292/ + ProxyPass / http://127.0.0.1:9292/ retry=0 + ProxyPassReverse / http://127.0.0.1:9292/