-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapache.conf
44 lines (44 loc) · 2.15 KB
/
apache.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<VirtualHost *:80>
ServerName finance.danielmoessner.de
Redirect 301 / "https://finance.danielmoessner.de/"
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName finance.danielmoessner.de
ServerAdmin [email protected]
# redirect
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1$1 [R=301,L]
# logs
ErrorLog ${APACHE_LOG_DIR}/finance.danielmoessner.de.error.log
CustomLog ${APACHE_LOG_DIR}/finance.danielmoessner.de.access.log combined
# process
WSGIDaemonProcess finance python-path=/home/finance.danielmoessner.de python-home=/home/finance.danielmoessner.de/tmp/venv display-name=%{GROUP}
WSGIProcessGroup finance
WSGIScriptAlias / /home/finance.danielmoessner.de/config/wsgi.py
# alias
Alias /static /home/finance.danielmoessner.de/tmp/static
Alias /media /home/finance.danielmoessner.de/tmp/media
# dirs
<Directory /home/finance.danielmoessner.de/tmp/static>
Require all granted
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 year"
</IfModule>
</Directory>
<Directory /home/finance.danielmoessner.de/tmp/media>
Require all granted
</Directory>
<Directory /home/finance.danielmoessner.de/config>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
# certbot
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/finance.danielmoessner.de/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/finance.danielmoessner.de/privkey.pem
</VirtualHost>
</IfModule>