Skip to content

Commit bc148ae

Browse files
committed
Add windows property
1 parent 4540e5b commit bc148ae

File tree

10 files changed

+108
-9
lines changed

10 files changed

+108
-9
lines changed

initServiceDownloads.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@
3737
- role: properties/qa
3838
- role: properties/shared
3939
- role: properties/talks
40+
- role: properties/windows

inventory/php.net.zone

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ pres2 IN CNAME pres2-php-net.ax4z.com.
109109
; wiki.internal is name of host, see Digital Ocean section
110110
wiki IN CNAME wiki-php-net.ax4z.com.
111111

112-
; windows.php.net is configured entirely as a physical host below
112+
; old windows.php.net website, which besides robots.txt now redirects to other locations (only)
113+
windows IN CNAME windows-php-net.ax4z.com.
113114

114115
; www is kind of a big deal
115116
www 300 IN CNAME www-php-net.ax4z.com.
@@ -170,12 +171,6 @@ php-jump2 IN AAAA 2a01:4f8:c2c:3b3f::1
170171
php-jump4 IN A 45.112.84.7
171172
php-jump4 IN AAAA 2a02:cb43:8000::1104
172173

173-
; OS Groups
174-
windows IN A 83.137.149.15
175-
windows IN AAAA 2a01:1b0:7999:419::7
176-
windows IN TYPE257 \# 22 000569737375656C657473656E63727970742E6F7267
177-
windows IN TYPE257 \# 12 0009697373756577696C643B
178-
179174
; eUKhost LTD. (contact Philip)
180175
euk2 IN A 109.203.109.170
181176
euk3 IN A 109.203.101.62
@@ -202,10 +197,11 @@ wiki.internal IN CNAME service1-ams.internal.php.net.
202197
service2-ams.internal IN A 206.189.2.9
203198
doc.internal IN CNAME service2-ams.internal.php.net.
204199
downloads.internal IN CNAME service2-ams.internal.php.net.
200+
people.internal IN CNAME service2-ams.internal.php.net.
205201
shared.internal IN CNAME service2-ams.internal.php.net.
206202
qa.internal IN CNAME service2-ams.internal.php.net.
207203
talks.internal IN CNAME service2-ams.internal.php.net.
208-
people.internal IN CNAME service2-ams.internal.php.net.
204+
windows.internal IN CNAME service2-ams.internal.php.net.
209205
www.internal IN CNAME service2-ams.internal.php.net.
210206

211207
; Abandoned

inventory/php/group_vars/service.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ doc_domain_alias: doc.internal.php.net
5555
analytics_domain: analytics.php.net
5656
analytics_domain_alias: analytics.internal.php.net
5757

58+
windows_domain: windows.php.net
59+
windows_domain_alias: windows.internal.php.net
60+
5861
www_domain: www.php.net
5962
www_domain_alias: www.internal.php.net
6063

roles/properties/downloads/templates/downloads.php.net.conf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232

3333
# Property Specific Changes
3434
RewriteEngine On
35-
RewriteRule ^/$ https://php.net/ [L]
35+
RewriteRule ^/$ https://www.php.net/downloads.php [L]
36+
RewriteRule ^/~windows$ https://www.php.net/downloads.php?os=windows [L]
37+
RewriteRule ^/~windows/$ https://www.php.net/downloads.php?os=windows [L]
3638

3739
# Handle Authorization Header
3840
RewriteCond %{HTTP:Authorization} .
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This restarts the Apache service
2+
- name: restart apache
3+
service:
4+
name: apache2
5+
state: restarted
6+
7+
- name: reload apache
8+
service:
9+
name: apache2
10+
state: reloaded
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- name: Create local directory to store Windows content
2+
file:
3+
state: directory
4+
dest: "{{ windows_docroot }}/{{ windows_domain }}"
5+
mode: "755"
6+
7+
- name: Put robots.txt in document root
8+
template:
9+
src: templates/robots.txt
10+
dest: "{{ windows_docroot }}/{{ windows_domain }}/robots.txt"
11+
mode: "644"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This role sets up the property windows.php.net with Apache together with the php module
2+
# It uses self-signed SSL certs
3+
4+
- name: Add Apache config for windows.php.net
5+
template:
6+
src: templates/{{ windows_config_file }}
7+
dest: "/etc/apache2/sites-available/{{ windows_config_file }}"
8+
notify: reload apache
9+
10+
- name: Enable config file
11+
shell: "a2ensite {{ windows_config_file }}"
12+
args:
13+
creates: "/etc/apache2/sites-enabled/{{ windows_config_file }}"
14+
notify: reload apache
15+
16+
- name: Ensure Apache is started and enabled
17+
service:
18+
name: apache2
19+
state: started
20+
enabled: yes
21+
22+
- include_tasks: deploy.yml
23+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Disallow: /
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<VirtualHost *:80>
2+
ServerName {{ windows_domain }}
3+
ServerAlias {{ windows_domain_alias }}
4+
5+
ServerAdmin {{ systems_email }}
6+
Redirect / https://windows.php.net/
7+
</VirtualHost>
8+
9+
<IfModule mod_ssl.c>
10+
<VirtualHost *:443>
11+
ServerAdmin {{ systems_email }}
12+
ServerName {{ windows_domain }}
13+
ServerAlias {{ windows_domain_alias }}
14+
15+
DocumentRoot {{ windows_docroot }}/{{ windows_domain }}
16+
17+
RewriteEngine on
18+
19+
# Redirect content to new location
20+
RewriteRule ^/$ https://www.php.net/downloads.php?os=windows
21+
RewriteRule ^/download$ https://www.php.net/downloads.php?os=windows
22+
RewriteRule ^/qa$ https://www.php.net/pre-release-builds.php#windows [NE]
23+
RewriteRule ^/qa/$ https://www.php.net/pre-release-builds.php#windows [NE]
24+
RewriteRule ^/snapshots$ https://www.php.net/pre-release-builds.php#windows [NE]
25+
RewriteRule ^/snapshots/$ https://www.php.net/pre-release-builds.php#windows [NE]
26+
RewriteRule ^/downloads/snaps https://www.php.net/pre-release-builds.php#windows [NE]
27+
RewriteRule ^/downloads/(.*) https://downloads.php.net/~windows/$1
28+
29+
# 403 Everything else besides robots.txt
30+
RewriteCond %{REQUEST_URI} !^/robots.txt
31+
RewriteRule ^/ - [F]
32+
33+
<Directory {{ windows_docroot }}/{{ windows_domain }}/>
34+
Options FollowSymLinks
35+
AllowOverride None
36+
Order allow,deny
37+
Allow from all
38+
</Directory>
39+
40+
# Logging
41+
ErrorLog ${APACHE_LOG_DIR}/{{ windows_domain }}-error.log
42+
CustomLog ${APACHE_LOG_DIR}/{{ windows_domain }}-access.log combined
43+
44+
# TLS Configuration with self-signed certificates
45+
SSLEngine on
46+
SSLCertificateFile /etc/ssl/certs/php-self-signed.crt
47+
SSLCertificateKeyFile /etc/ssl/certs/php-self-signed.key
48+
</VirtualHost>
49+
</IfModule>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
windows_docroot: /var/www/sites
2+
windows_config_file: windows.php.net.conf

0 commit comments

Comments
 (0)