source: main/trunk/greenstone3/src/ansible-playbooks/experimental-playbooks/v1/files/gs3-apache.conf.j2@ 38572

Last change on this file since 38572 was 38572, checked in by davidb, 5 months ago

Copy of the playbook to get Greenstone3 compiled up and deployed over https when first working, and before code tidyup

File size: 2.5 KB
Line 
1<VirtualHost *:{{ apache2_revproxy_config.http_port }}>
2
3 ServerName {{ apache2_revproxy_config.webserver_name }}
4 ServerAdmin {{ apache2_revproxy_config.serveradmin_email }}
5
6 DocumentRoot {{ gsdl3srchome }}/web
7
8 <Directory {{ gsdl3srchome }}/web>
9 Require all granted
10 </Directory>
11
12 #<Directory {{ gsdl3srchome }}/web>
13 # Options +FollowSymLinks
14 # # AllowOverride None
15 #</Directory>
16
17
18 # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
19 # error, crit, alert, emerg.
20 # It is also possible to configure the loglevel for particular
21 # modules, e.g.
22 #LogLevel info ssl:warn
23
24 ErrorLog ${APACHE_LOG_DIR}/{{ apache2_revproxy_config.config_root_name }}-error.log
25 CustomLog ${APACHE_LOG_DIR}/{{ apache2_revproxy_config.config_root_name }}-access.log combined
26
27
28 # To run as a Reverse Proxy, ProxyRequests needs to be off
29 # While this is the default for Apache2, let's be explicitly clear
30 ProxyRequests Off
31
32 # Needed so baseURL set correctly in LibraryMain.java
33 ProxyPreserveHost On
34
35 # The following is done to allow the proxied web server (localhost, Tomcat in our case)
36 # to have this header information passed on to it
37 #
38 RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
39 #HTTPS# RequestHeader set X-Forwarded-SSL expr=%{HTTPS}
40
41 #
42 # Before working with web-sockets, the following config entries were sufficient
43 # to connect the apache2 server with the tomcat one running Greenstone3
44 #
45 # ProxyPass /{{gsdl3servlet_external.context}} {{gsdl3servlet_internal.protocol}}://{{gsdl3servlet_internal.domain}}:{{gsdl3servlet_internal.port}}/{{gsdl3servlet_internal.context}}
46 # ProxyPassReverse /{{gsdl3servlet_external.context}} {{gsdl3servlet_internal.protocol}}://{{gsdl3servlet_internal.domain}}:{{gsdl3servlet_internal.port}}/{{gsdl3servlet_internal.context}}
47
48 # <Location /{{ gsdl3servlet_external.context }}>
49 # ProxyPassReverseCookiePath /{{gsdl3servlet_internal.context}} /{{ gsdl3servlet_external.context }}
50 # </Location>
51
52RewriteEngine on
53 RewriteRule "^/$" "/greenstone3/library" [END,NE,R=permanent]
54
55#HTTPS# RewriteCond %{HTTP:Upgrade} =websocket
56#HTTPS# RewriteRule /(.*) ws://localhost:8383/$1 [P,L]
57
58#HTTPS# RewriteCond %{HTTP:Upgrade} !=websocket
59#HTTPS# RewriteRule /(.*) http://localhost:8383/$1 [P,L]
60
61</VirtualHost>
Note: See TracBrowser for help on using the repository browser.