en:user_advanced:gs3_https
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:user_advanced:gs3_https [2025/02/13 00:42] – [Automatic certificate renewal for Tomcat (Greenstone 3.12)] kjdon | en:user_advanced:gs3_https [2025/02/13 01:02] (current) – [Using Apache to reverse proxy Tomcat] kjdon | ||
---|---|---|---|
Line 6: | Line 6: | ||
===== Using Apache to reverse proxy Tomcat ===== | ===== Using Apache to reverse proxy Tomcat ===== | ||
+ | |||
+ | Install and setup Apache with certbot SSL certificates. Then in the le-ssl.conf file (eg / | ||
+ | |||
+ | |||
+ | | ||
+ | | ||
+ | < | ||
+ | ProxyPassReverseCookiePath / | ||
+ | </ | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | In build.properties, | ||
+ | | ||
+ | revproxy.protocol=https | ||
+ | revproxy.domain=< | ||
+ | ## | ||
+ | ## | ||
+ | |||
===== Linux: Getting SSL certificates using certbot ===== | ===== Linux: Getting SSL certificates using certbot ===== | ||
- | A | ||
To have your webserver running under https, you need an SSL certificate. Many hosting platforms have tools to let you use HTTPS. See [[https:// | To have your webserver running under https, you need an SSL certificate. Many hosting platforms have tools to let you use HTTPS. See [[https:// | ||
Line 19: | Line 38: | ||
Take note of the "What you need" section. Then, choose your webserver (' | Take note of the "What you need" section. Then, choose your webserver (' | ||
+ | Port 80 must be open to obtain and renew a certificate. | ||
Once you have certbot installed, if you are using Apache, you can run | Once you have certbot installed, if you are using Apache, you can run | ||
Line 88: | Line 108: | ||
to be restarted to use the new certificate. | to be restarted to use the new certificate. | ||
- | You can set commands to be run before/ | + | You can set commands to be run before/ |
There is a script in Greenstone3 - '' | There is a script in Greenstone3 - '' | ||
- | '' | + | '' |
- | You can see the options for a renewal at / | + | You can see the options for a renewal at '' |
+ | |||
+ | Note, automatic running of this script requires some setup for sudo to be run with no password. See below. | ||
Line 100: | Line 122: | ||
There are two commands that need to be run as root - openssl converting the fullchain and key files into tomcats format (as letsencrypt files are owned by root), and the deleting of the root owned resultant file (we copy it into tomcat giving it local user ownership) | There are two commands that need to be run as root - openssl converting the fullchain and key files into tomcats format (as letsencrypt files are owned by root), and the deleting of the root owned resultant file (we copy it into tomcat giving it local user ownership) | ||
- | Script convert-https-cert.sh runs the openssl command. | + | Script |
- | We need to enable no password for this script and also for hte rm command. | + | We need to enable no password for this script and also for the '' |
+ | |||
+ | Edit the sudoers file (actually lets just edit a custom file in sudoers.d, so we are not mucking with the main file): | ||
+ | |||
+ | '' | ||
- | sudo visudo | + | < |
+ | # allow running of Greenstone3' | ||
+ | %sudo ALL=(root) NOPASSWD: < | ||
+ | %sudo ALL=(root) NOPASSWD: /usr/bin/rm /tmp/< | ||
+ | </code> | ||
- | # allow running of a script with no password | + | Substitute <PATH-TO-GREENSTONE3> |
- | %sudo ALL=(root) NOPASSWD: / | + | |
- | %sudo ALL=(root) NOPASSWD: /usr/bin/rm /tmp/sdl.sdb.org_fullchain_and_key.p12 | + | |
+ | |||
en/user_advanced/gs3_https.1739407330.txt.gz · Last modified: 2025/02/13 00:42 by kjdon