/
custom_vhost_80.erb
50 lines (41 loc) · 1.76 KB
/
custom_vhost_80.erb
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
<VirtualHost *:80>
ServerName default
## Vhost docroot
DocumentRoot "/var/www/html"
## Directories, there should at least be a declaration for /var/www/html
<Directory "/var/www/html">
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
AddType text/plain yaml yml
Require all granted
</Directory>
<% if @api_workers %> <% @api_workers.each do |worker| -%>
# WSGI configuration for worker <%= worker %>
# NOTE(dpawlik): use python-path param instead of python-home,
# if python version required to compile mod_wsgi was different.
WSGIDaemonProcess dlrn-<%= worker -%> python-home=/home/<%= worker %>/.venv group=<%= worker -%> processes=5 threads=1 user=<%= worker %>
WSGIScriptAlias /api-<%= worker -%> "/home/<%= worker -%>/api/dlrn-api-<%= worker -%>.wsgi"
<% if worker.start_with?('rhel8') -%>WSGIScriptAlias /api-<%= worker.gsub('rhel8', 'redhat') -%> "/home/<%= worker -%>/api/dlrn-api-<%= worker -%>.wsgi"<% end -%>
<Location "/api-<%= worker -%>">
Require all granted
SetEnv CONFIG_FILE /home/<%= worker -%>/api/dlrn-api-<%= worker -%>.cfg
WSGIProcessGroup dlrn-<%= worker %>
WSGIPassAuthorization On
</Location>
<% if worker.start_with?('rhel8') %>
<Location "/api-<%= worker.gsub('rhel8', 'redhat') -%>">
Require all granted
SetEnv CONFIG_FILE /home/<%= worker -%>/api/dlrn-api-<%= worker -%>.cfg
WSGIProcessGroup dlrn-<%= worker %>
WSGIPassAuthorization On
</Location><% end %>
<% end -%> <% end %>
## Logging
ErrorLog "/var/log/httpd/<%= @web_domain %>_error.log"
ServerSignature Off
CustomLog "/var/log/httpd/<%= @web_domain %>_access.log" combined
<% if @redirect_status %>
## Redirect rules
Redirect <%= @redirect_status %> / <%= @redirect_dest %>
<% end%>
</VirtualHost>