annotate modules/apache/examples/vhost.pp @ 257:675c1cc61eaf

Update Apache module to get CentOS 8 support Unfortunately it only fixes some bits. mod_wsgi still needs other approaches This also overrides the vhost modification to make them come last in the import order (after module loading)
author IBBoard <dev@ibboard.co.uk>
date Sun, 22 Dec 2019 14:43:29 -0500
parents
children d9352a684e62
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
257
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 ## Default vhosts, and custom vhosts
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 # NB: Please see the other vhost_*.pp example files for further
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 # examples.
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 # Base class. Declares default vhost on port 80 and default ssl
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 # vhost on port 443 listening on all interfaces and serving
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 # $apache::docroot
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 class { '::apache': }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 # Most basic vhost
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 apache::vhost { 'first.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 docroot => '/var/www/first',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 # Vhost with different docroot owner/group/mode
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 apache::vhost { 'second.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 docroot => '/var/www/second',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 docroot_owner => 'third',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 docroot_group => 'third',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 docroot_mode => '0770',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 # Vhost with serveradmin
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 apache::vhost { 'third.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 docroot => '/var/www/third',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 serveradmin => 'admin@example.com',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 # Vhost with ssl (uses default ssl certs)
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 apache::vhost { 'ssl.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 port => '443',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 docroot => '/var/www/ssl',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 ssl => true,
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39 # Vhost with ssl and specific ssl certs
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40 apache::vhost { 'fourth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41 port => '443',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 docroot => '/var/www/fourth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43 ssl => true,
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 ssl_cert => '/etc/ssl/fourth.example.com.cert',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 ssl_key => '/etc/ssl/fourth.example.com.key',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 # Vhost with english title and servername parameter
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 apache::vhost { 'The fifth vhost':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 servername => 'fifth.example.com',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 docroot => '/var/www/fifth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
54
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
55 # Vhost with server aliases
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
56 apache::vhost { 'sixth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57 serveraliases => [
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
58 'sixth.example.org',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59 'sixth.example.net',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
60 ],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62 docroot => '/var/www/fifth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
63 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
64
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
65 # Vhost with alternate options
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
66 apache::vhost { 'seventh.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
68 docroot => '/var/www/seventh',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69 options => [
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
70 'Indexes',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
71 'MultiViews',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
72 ],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
73 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
74
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
75 # Vhost with AllowOverride for .htaccess
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
76 apache::vhost { 'eighth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
77 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
78 docroot => '/var/www/eighth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
79 override => 'All',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
80 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
81
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
82 # Vhost with access and error logs disabled
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
83 apache::vhost { 'ninth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
84 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
85 docroot => '/var/www/ninth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
86 access_log => false,
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
87 error_log => false,
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
88 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
89
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
90 # Vhost with custom access and error logs and logroot
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
91 apache::vhost { 'tenth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
92 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
93 docroot => '/var/www/tenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
94 access_log_file => 'tenth_vhost.log',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
95 error_log_file => 'tenth_vhost_error.log',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
96 logroot => '/var/log',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
97 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
98
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
99 # Vhost with a cgi-bin
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
100 apache::vhost { 'eleventh.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
101 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
102 docroot => '/var/www/eleventh',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
103 scriptalias => '/usr/lib/cgi-bin',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
104 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
105
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
106 # Vhost with a proxypass configuration
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
107 apache::vhost { 'twelfth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
108 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
109 docroot => '/var/www/twelfth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
110 proxy_dest => 'http://internal.example.com:8080/twelfth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
111 no_proxy_uris => ['/login','/logout'],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
112 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
113
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
114 # Vhost to redirect /login and /logout
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
115 apache::vhost { 'thirteenth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
116 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
117 docroot => '/var/www/thirteenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
118 redirect_source => [
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
119 '/login',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
120 '/logout',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
121 ],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
122 redirect_dest => [
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
123 'http://10.0.0.10/login',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
124 'http://10.0.0.10/logout',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
125 ],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
126 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
127
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
128 # Vhost to permamently redirect
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
129 apache::vhost { 'fourteenth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
130 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
131 docroot => '/var/www/fourteenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
132 redirect_source => '/blog',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
133 redirect_dest => 'http://blog.example.com',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
134 redirect_status => 'permanent',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
135 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
136
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
137 # Vhost with a rack configuration
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
138 apache::vhost { 'fifteenth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
139 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
140 docroot => '/var/www/fifteenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
141 rack_base_uris => ['/rackapp1', '/rackapp2'],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
142 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
143
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
144
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
145 # Vhost to redirect non-ssl to ssl
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
146 apache::vhost { 'sixteenth.example.com non-ssl':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
147 servername => 'sixteenth.example.com',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
148 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
149 docroot => '/var/www/sixteenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
150 rewrites => [
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
151 {
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
152 comment => 'redirect non-SSL traffic to SSL site',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
153 rewrite_cond => ['%{HTTPS} off'],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
154 rewrite_rule => ['(.*) https://%{HTTP_HOST}%{REQUEST_URI}'],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
155 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
156 ],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
157 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
158
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
159 # Rewrite a URL to lower case
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
160 apache::vhost { 'sixteenth.example.com non-ssl':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
161 servername => 'sixteenth.example.com',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
162 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
163 docroot => '/var/www/sixteenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
164 rewrites => [
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
165 { comment => 'Rewrite to lower case',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
166 rewrite_cond => ['%{REQUEST_URI} [A-Z]'],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
167 rewrite_map => ['lc int:tolower'],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
168 rewrite_rule => ['(.*) ${lc:$1} [R=301,L]'],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
169 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
170 ],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
171 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
172
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
173 apache::vhost { 'sixteenth.example.com ssl':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
174 servername => 'sixteenth.example.com',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
175 port => '443',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
176 docroot => '/var/www/sixteenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
177 ssl => true,
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
178 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
179
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
180 # Vhost to redirect non-ssl to ssl using old rewrite method
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
181 apache::vhost { 'sixteenth.example.com non-ssl old rewrite':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
182 servername => 'sixteenth.example.com',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
183 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
184 docroot => '/var/www/sixteenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
185 rewrite_cond => '%{HTTPS} off',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
186 rewrite_rule => '(.*) https://%{HTTP_HOST}%{REQUEST_URI}',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
187 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
188 apache::vhost { 'sixteenth.example.com ssl old rewrite':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
189 servername => 'sixteenth.example.com',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
190 port => '443',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
191 docroot => '/var/www/sixteenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
192 ssl => true,
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
193 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
194
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
195 # Vhost to block repository files
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
196 apache::vhost { 'seventeenth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
197 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
198 docroot => '/var/www/seventeenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
199 block => 'scm',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
200 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
201
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
202 # Vhost with special environment variables
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
203 apache::vhost { 'eighteenth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
204 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
205 docroot => '/var/www/eighteenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
206 setenv => ['SPECIAL_PATH /foo/bin','KILROY was_here'],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
207 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
208
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
209 apache::vhost { 'nineteenth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
210 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
211 docroot => '/var/www/nineteenth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
212 setenvif => 'Host "^([^\.]*)\.website\.com$" CLIENT_NAME=$1',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
213 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
214
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
215 # Vhost with additional include files
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
216 apache::vhost { 'twentyieth.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
217 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
218 docroot => '/var/www/twelfth',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
219 additional_includes => ['/tmp/proxy_group_a','/tmp/proxy_group_b'],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
220 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
221
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
222 # Vhost with alias for subdomain mapped to same named directory
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
223 # http://example.com.loc => /var/www/example.com
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
224 apache::vhost { 'subdomain.loc':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
225 vhost_name => '*',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
226 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
227 virtual_docroot => '/var/www/%-2+',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
228 docroot => '/var/www',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
229 serveraliases => ['*.loc',],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
230 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
231
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
232 # Vhost with SSLProtocol,SSLCipherSuite, SSLHonorCipherOrder
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
233 apache::vhost { 'securedomain.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
234 priority => '10',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
235 vhost_name => 'www.securedomain.com',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
236 port => '443',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
237 docroot => '/var/www/secure',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
238 ssl => true,
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
239 ssl_cert => '/etc/ssl/securedomain.cert',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
240 ssl_key => '/etc/ssl/securedomain.key',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
241 ssl_chain => '/etc/ssl/securedomain.crt',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
242 ssl_protocol => '-ALL +TLSv1',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
243 ssl_cipher => 'ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
244 ssl_honorcipherorder => 'On',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
245 add_listen => false,
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
246 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
247
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
248 # Vhost with access log environment variables writing control
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
249 apache::vhost { 'twentyfirst.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
250 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
251 docroot => '/var/www/twentyfirst',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
252 access_log_env_var => 'admin',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
253 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
254
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
255 # Vhost with a passenger_base configuration
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
256 apache::vhost { 'twentysecond.example.com':
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
257 port => '80',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
258 docroot => '/var/www/twentysecond',
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
259 rack_base_uris => ['/passengerapp1', '/passengerapp2'],
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
260 }
675c1cc61eaf Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
261