Skip to content

Commit

Permalink
Add apache configs
Browse files Browse the repository at this point in the history
  • Loading branch information
noxilixon committed Nov 28, 2023
1 parent d1f4186 commit c9373eb
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ hugo build --minify -b <DOMAIN>
├── archetypes # Template for new content
├── content # Pages as markdown files
├── layouts/partials # Reusable elements
├── static # Images and Videos
└── themes # Theme, integrated via submodule
```
├── 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/<BRANCH_NAME>/`.

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.
30 changes: 30 additions & 0 deletions apache/dev.website.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<VirtualHost *:80>
ServerName dev.ff.berlin
ServerAdmin "[email protected]"

DocumentRoot /var/www/404

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/.well-known/
RewriteRule .* https://dev.ff.berlin%{REQUEST_URI} [R=301,L]
</VirtualHost>

<VirtualHost *:443>
ServerName dev.ff.berlin
ServerAdmin "[email protected]"
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

<Directory "/var/www/dev.berlin.freifunk.net/www">
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>

ErrorLog "/var/log/apache2/dev.berlin.freifunk.net-error.log"
CustomLog "/var/log/apache2/dev.berlin.freifunk.net-access.log" combined
</VirtualHost>
2 changes: 2 additions & 0 deletions apache/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /
30 changes: 30 additions & 0 deletions apache/website.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<VirtualHost *:80>
ServerName website.ff.berlin
ServerAdmin "[email protected]"

DocumentRoot /var/www/404

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/.well-known/
RewriteRule .* https://website.ff.berlin%{REQUEST_URI} [R=301,L]
</VirtualHost>

<VirtualHost *:443>
ServerName website.ff.berlin
ServerAdmin "[email protected]"
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

<Directory "/var/www/berlin.freifunk.net/www">
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>

ErrorLog "/var/log/apache2/berlin.freifunk.net-error.log"
CustomLog "/var/log/apache2/berlin.freifunk.net-access.log" combined
</VirtualHost>

0 comments on commit c9373eb

Please sign in to comment.