From c9373eb878c2151f4372a27f99f4eabb5e389270 Mon Sep 17 00:00:00 2001 From: Lino Date: Tue, 28 Nov 2023 13:48:28 +0100 Subject: [PATCH] Add apache configs --- README.md | 13 ++++++++++--- apache/dev.website.conf | 30 ++++++++++++++++++++++++++++++ apache/robots.txt | 2 ++ apache/website.conf | 30 ++++++++++++++++++++++++++++++ 4 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 apache/dev.website.conf create mode 100644 apache/robots.txt create mode 100644 apache/website.conf diff --git a/README.md b/README.md index e7f702b..5e5cfe2 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,13 @@ hugo build --minify -b ├── archetypes # Template for new content ├── content # Pages as markdown files ├── layouts/partials # Reusable elements -├── static # Images and Videos -└── themes # Theme, integrated via submodule -``` \ No newline at end of file +├── static # Images and videos +├── themes # Theme, integrated via submodule +└── apache # Server configs +``` + +## Deployment + +The website is deployed automatically via github actions. The main branch is at [berlin.freifunk.net](https://berlin.freifunk.net). The other branches could be accessed via `dev.berlin.freifunk.net//`. + +The actions are defined in `.github/workflows` and could be configured with [github variables and secrets](https://github.com/freifunk-berlin/berlin.freifunk.net/settings/secrets/actions). The configurations for the production and development webserver are in the `apache` directory. The development setup should also use the `robots.txt` file to deny indexing. \ No newline at end of file diff --git a/apache/dev.website.conf b/apache/dev.website.conf new file mode 100644 index 0000000..9d97028 --- /dev/null +++ b/apache/dev.website.conf @@ -0,0 +1,30 @@ + + ServerName dev.ff.berlin + ServerAdmin "info@berlin.freifunk.net" + + DocumentRoot /var/www/404 + + RewriteEngine On + RewriteCond %{REQUEST_URI} !^/.well-known/ + RewriteRule .* https://dev.ff.berlin%{REQUEST_URI} [R=301,L] + + + + ServerName dev.ff.berlin + ServerAdmin "info@berlin.freifunk.net" + SSLEngine on + SSLCertificateFile /etc/letsencrypt/live/dev.ff.berlin/cert.pem + SSLCertificateChainFile /etc/letsencrypt/live/dev.ff.berlin/chain.pem + SSLCertificateKeyFile /etc/letsencrypt/live/dev.ff.berlin/privkey.pem + + DocumentRoot /var/www/dev.berlin.freifunk.net/www/dev + + + Options FollowSymLinks + AllowOverride None + Require all granted + + + ErrorLog "/var/log/apache2/dev.berlin.freifunk.net-error.log" + CustomLog "/var/log/apache2/dev.berlin.freifunk.net-access.log" combined + diff --git a/apache/robots.txt b/apache/robots.txt new file mode 100644 index 0000000..77470cb --- /dev/null +++ b/apache/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / \ No newline at end of file diff --git a/apache/website.conf b/apache/website.conf new file mode 100644 index 0000000..a716c6f --- /dev/null +++ b/apache/website.conf @@ -0,0 +1,30 @@ + + ServerName website.ff.berlin + ServerAdmin "info@berlin.freifunk.net" + + DocumentRoot /var/www/404 + + RewriteEngine On + RewriteCond %{REQUEST_URI} !^/.well-known/ + RewriteRule .* https://website.ff.berlin%{REQUEST_URI} [R=301,L] + + + + ServerName website.ff.berlin + ServerAdmin "info@berlin.freifunk.net" + SSLEngine on + SSLCertificateFile /etc/letsencrypt/live/website.ff.berlin/cert.pem + SSLCertificateChainFile /etc/letsencrypt/live/website.ff.berlin/chain.pem + SSLCertificateKeyFile /etc/letsencrypt/live/website.ff.berlin/privkey.pem + + DocumentRoot /var/www/berlin.freifunk.net/www + + + Options FollowSymLinks + AllowOverride None + Require all granted + + + ErrorLog "/var/log/apache2/berlin.freifunk.net-error.log" + CustomLog "/var/log/apache2/berlin.freifunk.net-access.log" combined +