From bf7dff75d93084807c9f4a25dce7b715f82b1aff Mon Sep 17 00:00:00 2001 From: Puppet Date: Tue, 14 Nov 2023 16:10:28 -0600 Subject: [PATCH] Wifi CP fixes: Apache listen and servername Use the IP address for a Servername and make sure we listen on port 81 --- modules/rhizo_base/files/ports.conf | 16 ++++++++++++++++ modules/rhizo_base/manifests/wifi.pp | 14 ++++++++++++++ modules/rhizo_base/templates/portal.conf.erb | 1 + 3 files changed, 31 insertions(+) create mode 100644 modules/rhizo_base/files/ports.conf diff --git a/modules/rhizo_base/files/ports.conf b/modules/rhizo_base/files/ports.conf new file mode 100644 index 0000000..ac28387 --- /dev/null +++ b/modules/rhizo_base/files/ports.conf @@ -0,0 +1,16 @@ +# If you just change the port or add more ports here, you will likely also +# have to change the VirtualHost statement in +# /etc/apache2/sites-enabled/000-default.conf + +Listen 80 +Listen 81 + + + Listen 443 + + + + Listen 443 + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/modules/rhizo_base/manifests/wifi.pp b/modules/rhizo_base/manifests/wifi.pp index e81730b..b26e437 100644 --- a/modules/rhizo_base/manifests/wifi.pp +++ b/modules/rhizo_base/manifests/wifi.pp @@ -41,6 +41,20 @@ class rhizo_base::wifi { notify => Service['apache2'] } + file { '/etc/apache2/ports.conf': + ensure => present, + source => 'puppet:///modules/rhizo_base/ports.conf', + require => Package['apache2'], + notify => Service['apache2'] + } + + file { '/etc/apache2/mods-enabled/rewrite.load': + ensure => link, + target => '../mods-available/rewrite.load', + require => Package['apache2'], + notify => Service['apache2'] + } + firewall { '000 accept DHCP (udp port 67)': proto => 'udp', iniface => $wifi_if, diff --git a/modules/rhizo_base/templates/portal.conf.erb b/modules/rhizo_base/templates/portal.conf.erb index 5b8efe2..a06d05f 100644 --- a/modules/rhizo_base/templates/portal.conf.erb +++ b/modules/rhizo_base/templates/portal.conf.erb @@ -10,6 +10,7 @@ :81> #ServerName www.example.com + ServerName <%= @wifi_ip %> ServerAdmin webmaster@localhost DocumentRoot /var/rhizomatica/portal