Changeset 38556


Ignore:
Timestamp:
2024-01-16T16:12:08+13:00 (5 months ago)
Author:
davidb
Message:

Restructuring of cofig vars

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 }}>
    22
    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 }}
    65       
    7     DocumentRoot {{ gsdl3srchome}}/web
     6    DocumentRoot {{ gsdl3srchome }}/web
    87
    98        <Directory {{ gsdl3srchome }}/web>
     
    2322        #LogLevel info ssl:warn
    2423
    25         ErrorLog ${APACHE_LOG_DIR}/{{ apache2_servername }}-error.log
    26         CustomLog ${APACHE_LOG_DIR}/{{ apache2_servername }}-access.log combined
     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
    2726
    28         # ProxyPass /greenstone3-xxxx http://localhost:{{ gsdl3ports["localhost.port.http"] }}/greenstone3
    29         # ProxyPassReverse /greenstone3-xxxx http://localhost:{{ gsdl3ports["localhost.port.http"] }}/greenstone3
     27        # 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}}
    3029
    31         # #<Location /greenstone3-xxxx>
    32         # #    ProxyPassReverseCookiePath /greenstone3 /greenstone3-xxxx
    33         # #</Location>
     30        # <Location /{{ gsdl3servlet_external.context }}>
     31        #     ProxyPassReverseCookiePath /{{gsdl3servlet_internal.context}} /{{ gsdl3servlet_external.context }}
     32        # </Location>
    3433
    35 RewriteEngine on
    36     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]
    3837
    3938</VirtualHost>
  • main/trunk/greenstone3/src/ansible-playbooks/reverse-proxy-playbook.yml

    r38542 r38556  
    2020      shell: /usr/sbin/a2enmod rewrite headers proxy proxy_http proxy_wstunnel
    2121
    22     - name: Set up Apache virtualhost
     22    - name: Set up Apache2 virtualhost
    2323      template:
    2424        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"
    2636
    2737    - name: Enable new site
    28       shell: /usr/sbin/a2ensite {{ apache2_http_conf }}
     38      shell: /usr/sbin/a2ensite {{ apache2_revproxy_config.config_root_name }}.conf
    2939      notify: Reload Apache
    3040
    31 #    - name: "UFW - Allow HTTP on port {{ apache2_http_port }}"
     41#    - name: "UFW - Allow HTTP on port {{ gsdl3servlet_external.port | default('80',true) }}"
    3242#      ufw:
    3343#        rule: allow
    34 #        port: "{{ apache2_http_port }}"
     44#        port: "{{ gsdl3servlet_external.port | default('80',true) }}"
    3545#        proto: tcp
    3646
  • main/trunk/greenstone3/src/ansible-playbooks/vars/default-core.yml

    r38541 r38556  
    44gsdl3srchome: /mnt/intermuse/greenstone3-ansible-svn
    55
    6 # # gsdl3port:     5353
     6digital_librarian_info: {
     7  fullname: "Sam Someone",
     8  email:    "[email protected]"
     9}
    710
    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 ...
     12tech_support_info: {
     13  fullname: "Terry Tother",
     14  email:     "[email protected]"
     15}
    1316
    14 #apache2_serveradmin_email: "[email protected]"
    15 #apache2_servername:        "mygreenstone-dl"
    16 #apache2_servername_fqdn:   "{{ apache2_servername }}.mydomain.org"
     17gsdl3servlet_internal: {
     18  protocol:      "http",
     19  domain:        "localhost",
    1720
    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}
    2128
    22 apache2_http_port: "80"
    23 apache2_http_conf: "{{ apache2_servername }}.conf"
     29
     30gsdl3_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
     45gsdl3servlet_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?
     57apache2_as_revproxy: true
     58
     59apache2_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
     76gsdl3_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
    2498
    2599
Note: See TracChangeset for help on using the changeset viewer.