From cac7545070c16d47f35200f4177c59a52f2189c6 Mon Sep 17 00:00:00 2001 From: "a.genus" Date: Thu, 24 Dec 2015 15:59:57 +0300 Subject: [PATCH 1/2] Add listen directive to vhosts templates and remove ports.conf --- apache/debian_full.sls | 5 +++++ apache/vhosts/proxy.tmpl | 2 ++ apache/vhosts/redirect.tmpl | 2 ++ apache/vhosts/standard.tmpl | 2 ++ 4 files changed, 11 insertions(+) diff --git a/apache/debian_full.sls b/apache/debian_full.sls index 44bba6b..a209088 100644 --- a/apache/debian_full.sls +++ b/apache/debian_full.sls @@ -37,4 +37,9 @@ a2dissite 000-default{{ apache.confext }}: - require: - pkg: apache +/etc/apache2/ports.conf: + file.absent: + - require: + - pkg: apache + {% endif %} #END: os = debian diff --git a/apache/vhosts/proxy.tmpl b/apache/vhosts/proxy.tmpl index ae6bc8d..f4edb85 100644 --- a/apache/vhosts/proxy.tmpl +++ b/apache/vhosts/proxy.tmpl @@ -22,6 +22,8 @@ 'ProxyRoute': site.get('ProxyRoute', {}), } %} +Listen {{ vals.interface }}:{{ vals.port }} + ServerName {{ vals.ServerName }} {% if site.get('ServerAlias') != False %}ServerAlias {{ vals.ServerAlias }}{% endif %} diff --git a/apache/vhosts/redirect.tmpl b/apache/vhosts/redirect.tmpl index 0f81ca5..e083642 100644 --- a/apache/vhosts/redirect.tmpl +++ b/apache/vhosts/redirect.tmpl @@ -23,6 +23,8 @@ } %} +Listen {{ vals.interface }}:{{ vals.port }} + ServerName {{ vals.ServerName }} {% if site.get('ServerAlias') != False %}ServerAlias {{ vals.ServerAlias }}{% endif %} diff --git a/apache/vhosts/standard.tmpl b/apache/vhosts/standard.tmpl index 0aee974..379d469 100644 --- a/apache/vhosts/standard.tmpl +++ b/apache/vhosts/standard.tmpl @@ -37,6 +37,8 @@ }, } %} +Listen {{ vals.interface }}:{{ vals.port }} + ServerName {{ vals.ServerName }} {% if site.get('ServerAlias') != False %}ServerAlias {{ vals.ServerAlias }}{% endif %} From 5d03deb3b51bd44d64bf9e8c43a989744804b534 Mon Sep 17 00:00:00 2001 From: "a.genus" Date: Thu, 24 Dec 2015 16:09:18 +0300 Subject: [PATCH 2/2] Remove ports.conf inclusion --- apache/files/Debian/apache-2.4.config.jinja | 7 ------- 1 file changed, 7 deletions(-) diff --git a/apache/files/Debian/apache-2.4.config.jinja b/apache/files/Debian/apache-2.4.config.jinja index 854fc2d..e630836 100644 --- a/apache/files/Debian/apache-2.4.config.jinja +++ b/apache/files/Debian/apache-2.4.config.jinja @@ -34,10 +34,6 @@ # together by including all remaining configuration files when starting up the # web server. # -# * ports.conf is always included from the main configuration file. It is -# supposed to determine listening ports for incoming connections which can be -# customized anytime. -# # * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/ # directories contain particular configuration snippets which manage modules, # global configuration fragments, or virtual host configurations, @@ -142,9 +138,6 @@ LogLevel warn IncludeOptional mods-enabled/*.load IncludeOptional mods-enabled/*.conf -# Include list of ports to listen on -Include ports.conf - # Sets the default security model of the Apache2 HTTPD server. It does # not allow access to the root filesystem outside of /usr/share and /var/www.