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:14] – [certbot renewal timer] 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 33: | Line 53: | ||
==== certbot renewal timer ==== | ==== certbot renewal timer ==== | ||
- | Once you use certbot to obtain certificates, | + | Once you use certbot to obtain certificates, |
+ | If you are using Apache, you won't need to do anything else, as it links directly to the live certificates. If you are using Tomcat directly with HTTPS, then you will need to manually install the certificate into Tomcat or follow the instructions for making that happen automatically. See [[en: | ||
+ | |||
+ | === Manual renewal === | ||
Note, if your port 80 is not open by default, and you opened it just for generating the initial certificates, | Note, if your port 80 is not open by default, and you opened it just for generating the initial certificates, | ||
* '' | * '' | ||
Line 41: | Line 64: | ||
If your renewal has failed, you will get an email telling you this. | If your renewal has failed, you will get an email telling you this. | ||
+ | === Checking the logs === | ||
To check the logs: '' | To check the logs: '' | ||
Line 47: | Line 71: | ||
The log will tell you eg that your renewal had failed bacuse it couldn' | The log will tell you eg that your renewal had failed bacuse it couldn' | ||
- | Note, if you are using Tomcat directly, then you will need to manually install | + | === Viewing |
'' | '' | ||
Line 68: | Line 92: | ||
'' | '' | ||
+ | |||
+ | ===== Setting up Tomcat with SSL Certificates ===== | ||
+ | |||
+ | Greenstone provides some ant targets to help you set up Tomcat with HTTPS. | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
==== Automatic certificate renewal for Tomcat (Greenstone 3.12) ==== | ==== Automatic certificate renewal for Tomcat (Greenstone 3.12) ==== | ||
- | While certbot sets up timers for automatic renewal of certificates, | + | While certbot sets up timers for automatic renewal of certificates, |
+ | to be restarted to use the new certificate. | ||
+ | |||
+ | You can set commands to be run before/ | ||
+ | |||
+ | There is a script in Greenstone3 - '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | 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. | ||
+ | |||
+ | |||
+ | === Getting things to run as sudo with no password === | ||
+ | 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 '' | ||
+ | We need to enable no password | ||
+ | |||
+ | Edit the sudoers file (actually lets just edit a custom file in sudoers.d, so we are not mucking with the main file): | ||
+ | |||
+ | '' | ||
+ | |||
+ | < | ||
+ | # allow running of Greenstone3' | ||
+ | %sudo ALL=(root) NOPASSWD: < | ||
+ | %sudo ALL=(root) NOPASSWD: /usr/bin/rm / | ||
+ | </ | ||
+ | |||
+ | Substitute < | ||
+ | |||
+ | |||
en/user_advanced/gs3_https.1739405688.txt.gz · Last modified: 2025/02/13 00:14 by kjdon