This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspoilr.apacheconf
210 lines (169 loc) · 5.57 KB
/
spoilr.apacheconf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<VirtualHost *:80>
#####
# This is the apache conf that should go in /etc/httpd/conf.d or wherever your linux distro
# wants apache confs to go. The main meat of spoilr apache conf is in the .htaccess file
# in the docroot which is part of the hunt repo and not spoilr.
####
#####
#CHANGE THESE TO WHATEVER VHOST NAMES YOU WILL ACTUALLY USE!
#####
ServerName www.aliceshrugged.com
ServerAlias www-dev.aliceshrugged.com
ServerAlias aliceshrugged.com
ServerAlias hq.aliceshrugged.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/spoilr
RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 0
ErrorDocument 404 /static/404.html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
#####
# Hackety hack to force all admin requests to go to the HQ server
#####
RewriteEngine on
RewriteCond %{HTTP_HOST} !^hq [NC]
RewriteCond %{REQUEST_URI} ^/dynamic/admin [OR]
RewriteCond %{REQUEST_URI} ^/dynamic/hq
#### CHANGE THIS TO WHATEVER HOST YOU WANT ALL ADMIN STUFF TO GO TO
#### Or just keep it the same if you're running on a single server
RewriteRule ^(.*)$ http://hq.aliceshrugged.com/$1 [L]
#####
# Hackety hack to make hq.aliceshrugged.com root go into /hq subdir for index file
# So there can be a nice index for people looking to do HQ things
####
RewriteCond %{HTTP_HOST} ^hq.aliceshrugged.com [NC]
RewriteCond %{REQUEST_URI} ^/index.html [OR]
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_URI} ^$
#### CHANGE THIS TO WHATEVER HOST YOU WANT ALL ADMIN STUFF TO GO TO
#### Or just keep it the same if you're running on a single server
RewriteRule ^(.*)$ http://hq.aliceshrugged.com/hq/ [L]
#####
# Canonicalize to www hostname
# Obviously change this to whatever your hunt domain name will be
#####
RewriteCond %{HTTP_HOST} ^aliceshrugged.com [NC]
RewriteRule ^(.*)$ http://www.aliceshrugged.com$1 [L]
<Directory /var/www/spoilr>
Options FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
AuthUserFile /home/hunt/htpasswd/htpasswd
AuthName "Identify Yourself"
AuthType Basic
Require valid-user
</Directory>
<Directory /var/www/spoilr/teams>
Order allow,deny
Allow from all
AllowOverride AuthConfig
</Directory>
<Files ~ "\.js$">
Header merge Cache-Control no-cache
Header merge Cache-Control no-store
</Files>
#####
# Hackety hack auth config so going to http://logout:[email protected]/logout
# Will reset auth info (logout) for most web browsers
#####
<Directory /var/www/spoilr/logout>
AuthUserFile /home/djangoapps/spoilr/spoilr/apache/htpasswd.logout
AuthName "Identify Yourself"
AuthType Basic
Require valid-user
</Directory>
<Location /dynamic>
AuthType Basic
AuthName "Identify Yourself"
AuthUserFile /home/hunt/htpasswd/htpasswd
Require valid-user
</Location>
#####
# Only hunthq and rtb users can access django admin
#####
<Location /dynamic/admin>
AuthType Basic
AuthName "Identify Yourself"
AuthUserFile /home/hunt/htpasswd/htpasswd
Require User hunthq
Require User rtb
</Location>
#####
# Only hunthq and rtb users can access hq utils
#####
<Location /dynamic/hq>
AuthType Basic
AuthName "Identify Yourself"
AuthUserFile /home/hunt/htpasswd/htpasswd
Require User hunthq
Require User rtb
</Location>
#####
# Only rtb (run time boss user) can access gatekeeper util
#####
<Location /dynamic/hq/gatekeeper>
AuthType Basic
AuthName "Identify Yourself"
AuthUserFile /home/hunt/htpasswd/htpasswd
Require User rtb
</Location>
#####
# Set the wsgi daemon process name as appropriate for your hunt
# Or don't. It's really just cosmetic for your process listing.
####
WSGIDaemonProcess aliceshrugged.com display-name=%{GROUP}
WSGIProcessGroup aliceshrugged.com
WSGIScriptAlias /dynamic /home/djangoapps/spoilr/spoilr/apache/django.wsgi
Alias /static/admin /var/www/spoilr/admin
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel info
### New combined log format to include timing in each request
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\" %T" combined
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
<VirtualHost *:80>
#####
# Hackety hack virtualhost
# So requests to localhost
# don't go through apache auth and redirect hell so that monitoring server-status from localhost works
#####
ServerName localhost.localdomain
ServerAlias localhost
ServerAlias 127.0.0.1
<IfModule mod_status.c>
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Uncomment and change the "192.0.2.0/24" to allow access from other hosts.
#
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1 ::1
# Allow from 192.0.2.0/24
</Location>
# Determine if mod_status displays the first 63 characters of a request or
# the last 63, assuming the request itself is greater than 63 chars.
# Default: Off
#SeeRequestTail On
<IfModule mod_proxy.c>
# Show Proxy LoadBalancer status in mod_status
ProxyStatus On
</IfModule>
</IfModule>
</VirtualHost>