From ea6afb92048c835752fe1c72ad52f424e2df88a8 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 19 Apr 2022 19:35:21 +0200 Subject: add sample apache2 config files --- doc/examples/hydrilla.example.com.conf | 49 ++++++++++++++++++++++ doc/examples/hydrilla.example.com.tls.conf | 65 ++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 doc/examples/hydrilla.example.com.conf create mode 100644 doc/examples/hydrilla.example.com.tls.conf diff --git a/doc/examples/hydrilla.example.com.conf b/doc/examples/hydrilla.example.com.conf new file mode 100644 index 0000000..0d94c05 --- /dev/null +++ b/doc/examples/hydrilla.example.com.conf @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: CC0-1.0 + +# Sample Apache2 configuration file for Hydrilla server (over unencrypted HTTP). +# +# Copyright (C) 2022 Wojtek Kosior + + +# Please adapt this file according to your needs can place it file under +# Apache2's available site configs directory which will be +# /etc/apache2/sites-available/ or similar. Then, enable it using the following +# command: +# a2ensite hydrilla.example.com +# The new configuration will only take effect after you restart/reload Apache2 +# daemon. + +# Keep in mind that due to some external limitations Haketilo will not connect +# to HTTP Hydrilla servers running elsewhere than localhost. To get a working +# public Hydrilla server you should obtain a TLS certificate and use the +# attached hydrilla.example.com.tls.conf file instead of this one. + +# This configuration file assumes Hydrilla is installed under Python's default +# load path and that the attached hydrilla.wsgi sample script has been saved as +# /var/lib/hydrilla/wsgi/hydrilla.wsgi + + + ServerName hydrilla.example.com + ServerAdmin admin@example.com + + DocumentRoot /var/lib/hydrilla/malcontent_dir + + + Require all granted + + + + ForceType application/json + + + WSGIScriptReloading On + + + Require all granted + + + WSGIScriptAliasMatch "^/((resource|mapping)/[^/]+[.]json|query)$" "/var/lib/hydrilla/wsgi/hydrilla.wsgi/$1" + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + diff --git a/doc/examples/hydrilla.example.com.tls.conf b/doc/examples/hydrilla.example.com.tls.conf new file mode 100644 index 0000000..5f14554 --- /dev/null +++ b/doc/examples/hydrilla.example.com.tls.conf @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: CC0-1.0 + +# Sample Apache2 configuration file for Hydrilla server (over HTTPS). +# +# Copyright (C) 2022 Wojtek Kosior + + +# Please adapt this file according to your needs can place it file under +# Apache2's available site configs directory which will be +# /etc/apache2/sites-available/ or similar. Then, enable it using the following +# command: +# a2ensite hydrilla.example.com.tls +# The new configuration will only take effect after you restart/reload Apache2 +# daemon. + +# The following configuration enables TLS encryption. If you want to run a local +# Hydrilla server utilizing plain HTTP, use the attached +# hydrilla.example.com.conf file instead of this one or run a standalone +# development server using the hydrilla command. + +# This configuration file assumes Hydrilla is installed under Python's default +# load path and that the attached hydrilla.wsgi sample script has been saved as +# /var/lib/hydrilla/wsgi/hydrilla.wsgi + + + ServerName hydrilla.example.com + + Redirect permanent / https://hydrilla.example.com/ + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + + + + ServerName hydrilla.example.com + ServerAdmin admin@example.com + + DocumentRoot /var/lib/hydrilla/malcontent_dir + + + Require all granted + + + + ForceType application/json + + + WSGIScriptReloading On + + + Require all granted + + + WSGIScriptAliasMatch "^/((resource|mapping)/[^/]+[.]json|query)$" "/var/lib/hydrilla/wsgi/hydrilla.wsgi/$1" + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + SSLEngine on + SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem + SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem + SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem + + -- cgit v1.2.3