Changeset 38556
- Timestamp:
- 2024-01-16T16:12:08+13:00 (5 months ago)
- Location:
- main/trunk/greenstone3/src/ansible-playbooks
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/ansible-playbooks/files/gs3-apache.conf.j2
r38541 r38556 1 <VirtualHost *:{{ apache2_ http_port }}>1 <VirtualHost *:{{ apache2_revproxy_config.http_port }}> 2 2 3 ServerName {{ apache2_servername_fqdn }} 4 5 ServerAdmin {{ apache2_serveradmin_email }} 3 ServerName {{ apache2_revproxy_config.webserver_name }} 4 ServerAdmin {{ apache2_revproxy_config.serveradmin_email }} 6 5 7 DocumentRoot {{ gsdl3srchome }}/web6 DocumentRoot {{ gsdl3srchome }}/web 8 7 9 8 <Directory {{ gsdl3srchome }}/web> … … 23 22 #LogLevel info ssl:warn 24 23 25 ErrorLog ${APACHE_LOG_DIR}/{{ apache2_servername }}-error.log26 CustomLog ${APACHE_LOG_DIR}/{{ apache2_ servername }}-access.log combined24 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 27 26 28 # ProxyPass /greenstone3-xxxx http://localhost:{{ gsdl3ports["localhost.port.http"] }}/greenstone329 # ProxyPassReverse / greenstone3-xxxx http://localhost:{{ gsdl3ports["localhost.port.http"] }}/greenstone327 # ProxyPass /{{gsdl3servlet_external.context}} {{gsdl3servlet_internal.protocol}}://{{gsdl3servlet_internal.domain}}:{{gsdl3servlet_internal.port}}/{{gsdl3servlet_internal.context}} 28 # ProxyPassReverse /{{gsdl3servlet_external.context}} {{gsdl3servlet_internal.protocol}}://{{gsdl3servlet_internal.domain}}:{{gsdl3servlet_internal.port}}/{{gsdl3servlet_internal.context}} 30 29 31 # #<Location /greenstone3-xxxx>32 # # ProxyPassReverseCookiePath /greenstone3 /greenstone3-xxxx33 # #</Location>30 # <Location /{{ gsdl3servlet_external.context }}> 31 # ProxyPassReverseCookiePath /{{gsdl3servlet_internal.context}} /{{ gsdl3servlet_external.context }} 32 # </Location> 34 33 35 RewriteEngine on36 RewriteCond %{SERVER_NAME} ={{apache2_servername_fqdn}}37 RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]34 #RewriteEngine on 35 # RewriteCond %{SERVER_NAME} ={{ apache2_revproxy_config.webserver_name }} 36 # RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] 38 37 39 38 </VirtualHost> -
main/trunk/greenstone3/src/ansible-playbooks/reverse-proxy-playbook.yml
r38542 r38556 20 20 shell: /usr/sbin/a2enmod rewrite headers proxy proxy_http proxy_wstunnel 21 21 22 - name: Set up Apache virtualhost22 - name: Set up Apache2 virtualhost 23 23 template: 24 24 src: "files/gs3-apache.conf.j2" 25 dest: "/etc/apache2/sites-available/{{ apache2_http_conf }}" 25 dest: "/etc/apache2/sites-available/{{ apache2_revproxy_config.config_root_name }}.conf" 26 27 - name: Adjusting Greenstone3 installations index.html to work in Apache2 DocumentRoot 28 ansible.builtin.replace: 29 path: "{{ gsdl3srchome }}/web/index.html" 30 #regexp: 'href="' 31 #line: 'href="{{ gsdl3servlet_external.context }}/' 32 #regexp: 'href="(?!http://|/{{gsdl3servlet_external.context}}/)' 33 regexp: 'href="(?!http://|/)' 34 replace: 'href="/{{ gsdl3servlet_external.context }}/' 35 ## dest: "/etc/apache2/sites-available/{{ apache2_revproxy_config.config_root_name }}.conf" 26 36 27 37 - name: Enable new site 28 shell: /usr/sbin/a2ensite {{ apache2_ http_conf }}38 shell: /usr/sbin/a2ensite {{ apache2_revproxy_config.config_root_name }}.conf 29 39 notify: Reload Apache 30 40 31 # - name: "UFW - Allow HTTP on port {{ apache2_http_port}}"41 # - name: "UFW - Allow HTTP on port {{ gsdl3servlet_external.port | default('80',true) }}" 32 42 # ufw: 33 43 # rule: allow 34 # port: "{{ apache2_http_port}}"44 # port: "{{ gsdl3servlet_external.port | default('80',true) }}" 35 45 # proto: tcp 36 46 -
main/trunk/greenstone3/src/ansible-playbooks/vars/default-core.yml
r38541 r38556 4 4 gsdl3srchome: /mnt/intermuse/greenstone3-ansible-svn 5 5 6 # # gsdl3port: 5353 6 digital_librarian_info: { 7 fullname: "Sam Someone", 8 email: "[email protected]" 9 } 7 10 8 gsdl3ports: { "localhost.port.http": 6363, 9 "tomcat.shutdown.port": 6305, 10 "tomcat.ajp.port": 6309,11 "derby.server.port": 6327, 12 "tomcat.port.https": 6443}11 # To allow tech-support to be someone different ... 12 tech_support_info: { 13 fullname: "Terry Tother", 14 email: "[email protected]" 15 } 13 16 14 #apache2_serveradmin_email: "[email protected]" 15 #apache2_servername: "mygreenstone-dl" 16 #apache2_servername_fqdn: "{{ apache2_servername }}.mydomain.org" 17 gsdl3servlet_internal: { 18 protocol: "http", 19 domain: "localhost", 17 20 18 apache2_serveradmin_email: "[email protected]" 19 apache2_servername: "ansible-test" 20 apache2_servername_fqdn: "{{ apache2_servername }}.sowemustthink.space" 21 # For testing purposes, work with a '63' range 22 #port: "8383", 23 port: "6363", 24 25 context: "greenstone3", 26 servlet: "library" 27 } 21 28 22 apache2_http_port: "80" 23 apache2_http_conf: "{{ apache2_servername }}.conf" 29 30 gsdl3_buildproperties_ports: { 31 "localhost.port.http": "{{ gsdl3servlet_internal.explicit_port }}", 32 33 #"tomcat.shutdown.port": 8305, 34 #"tomcat.ajp.port": 8309, 35 #"derby.server.port": 8327, 36 #"tomcat.port.https": 8443 37 38 # For testing purposes, work with a '63' range and 64 for https 39 "tomcat.shutdown.port": 6305, 40 "tomcat.ajp.port": 6309, 41 "derby.server.port": 6327, 42 "tomcat.port.https": 6443 43 } 44 45 gsdl3servlet_external: { 46 protocol: "http", 47 #protocol: "https", 48 #domain: "<mygreenstone-dl>.<mydomain.org>", 49 domain: "ansible-test.sowemustthink.space", 50 #port: "80", # only need to set this if using 'http' and *not* using '80' 51 #port: "443", # only need to set this if using 'https' and *not* using '443' 52 context: "greenstone3", 53 servlet: "library" 54 } 55 56 # Using Apache2 as a reverse-proxy server? 57 apache2_as_revproxy: true 58 59 apache2_revproxy_config: { 60 # 61 # The following is typically kept the same as the subdomain part of gsdl3servlet_external.domain 62 # This is done automatically in the following line using default() 63 # 64 # If you want to set this to a different value, then edit '' to include the desired value 65 # 66 config_root_name: "{{ '' | default(gsdl3servlet_external['domain'].split('.') | first(),true) }}", 67 68 serveradmin_email: "{{ tech_support_info.email }}", 69 webserver_name: "{{ gsdl3servlet_external.domain }}", 70 http_port: "80", 71 https_port: "443" 72 } 73 74 #---- 75 76 gsdl3_buildproperties_revproxy: { 77 "revproxy.protocol": "{{ gsdl3servlet_external.protocol }}", 78 "revproxy.domain": "{{ gsdl3servlet_external.domain }}", 79 "revproxy.opt_port": "{{ gsdl3servlet_external.port }}", 80 "revproxy.context": "{{ gsdl3servlet_external.context }}" 81 } 82 83 84 #apache2_serveradmin_email: tech_support_info.email 85 #apache2_webserver_name: gsdl3servlet_external.domain 86 # 87 ##apache2_servername: "mygreenstone-dl" 88 ##apache2_servername_fqdn: "{{ apache2_servername }}.mydomain.org" 89 # 90 #apache2_serveradmin_email: "[email protected]" 91 #apache2_servername: "ansible-test" 92 #apache2_servername_fqdn: "{{ apache2_servername }}.sowemustthink.space" 93 94 #apache2_http_port: "80" 95 #apache2_http_conf: "{{ apache2_servername }}.conf" 96 97 24 98 25 99
Note:
See TracChangeset
for help on using the changeset viewer.