From 5f2ff4ccda8a6b228f28359c99b5bf037e2f0eed Mon Sep 17 00:00:00 2001 From: David Beniamine <david.beniamine@tetras-libre.fr> Date: Mon, 11 May 2020 16:18:29 +0200 Subject: [PATCH] Apache2 configuration --- Readme.md | 11 +++++++++-- odk.conf | 12 ++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 odk.conf diff --git a/Readme.md b/Readme.md index 41175d3..cc58883 100644 --- a/Readme.md +++ b/Readme.md @@ -15,9 +15,16 @@ This is a docker-compose setup for [ODK](https://getodk.org) + Most defaults are set according to .env 4. Get the sql `docker-compose exec front cat webapps/ODK\ Aggregate/create_db_and_user.sql` 5. Run `docker-compose exec db psql -U aggregate` and paste SQL from step 4 -6. Run `docker-compose exec front mv webapps/ODK\ Aggregate/ODKAggregate.war webapps/` +6. Run `docker-compose exec front mv webapps/ODK\ Aggregate/ODKAggregate.war webapps/ROOT.war` 7. Restart the docker-compose `docker-compose down; docker-compose up -d` -At this point everything should be configured, go to `http://localhost:8080/ODKAggregate` and finish installation process. +At this point everything should be configured, go to `http://localhost:8080/` and finish installation process. Default password is `aggregate`, username is the one you set in step 2. + +## Use it behing an apache2 proxy + +1. Follow install instruction using a Fully Qualified Domain Name in step 2 instead of `localhost` +2. Copy the odk.conf file to `/etc/apache2/sites-available/odk.conf` and adapt it +3. `a2ensite odk.conf && apache2ctl graceful` +3. **Recommended** switch to HTTPS using [certbot](https://certbot.eff.org/) diff --git a/odk.conf b/odk.conf new file mode 100644 index 0000000..b99472c --- /dev/null +++ b/odk.conf @@ -0,0 +1,12 @@ +<VirtualHost *:80> + ServerName <FQDN> + + ProxyRequests On + ProxyPreserveHost on + + ProxyPass / http://127.0.0.1:8080/ + ProxyPassReverse / http://127.0.0.1:8080/ + + CustomLog ${APACHE_LOG_DIR}/<FQDN>.access.log combined + ErrorLog ${APACHE_LOG_DIR}/<FQDN>.error.log +</VirtualHost> -- GitLab