SSL Configuration#
For SSL to work you need to adjust some parameters in structr.conf.
application.https.enabled = true
application.https.port = 443
application.keystore.path = [filename of keystore file - should reside in structr-ui folder]
application.keystore.password = [keystore password]
Note: See this tutorial on how to create a keystore file.
Additional configuration
A forced redirect from http to https can be achieved by setting the structr.conf setting HttpService.force.https
to true.
Tutorial for letsencrypt
- Install certbot for your distribution
- Select “None of the above” as “Software”
- Select your distribution for “System”
- follow the instructions under “Install”
- Stop Structr because certbot needs to bind to Port 80
service structr stop
- Run certbot (replace
<your-domain>
with your domain) and provide the necessary information: email address, agree to TOS and allow sharing of email address.
certbot certonly --standalone -w ./ -d <your-domain>
- Change into the directory where certbot stored your certificate
cd /etc/letsencrypt/live/<your-domain>/
- Convert the certificate to a compatible keystore. You will be asked to create a password - be sure to write it down, you will need it later!
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
- Move the keystore to the structr directory
mv keystore.pkcs12 /usr/lib/structr/
- Change to the structr directory
cd /usr/lib/structr/
- Edit structr.conf accordingly
application.https.enabled = true application.keystore.path = keystore.pkcs12 application.keystore.password = <your-password>
- Start structr
service structr start