Skip to content
Snippets Groups Projects
Commit 2d9a1b2c authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

update apache config for ssl

parent 9c16a7cb
No related branches found
No related tags found
No related merge requests found
......@@ -96,7 +96,7 @@ Remember to use a secret key that is not stored in any repository or similar, an
ProxyPass / uwsgi://127.0.0.1:3035/
```
or create a new config (.conf) file (similar to ``apache-akplanning.conf``) replacing $SUBDOMAIN with the subdomain the system should be available under, and $MAILADDRESS with the e-mail address of your administrator. Copy or symlink it to ``/etc/apache2/sites-available``. Then symlink it to ``sites-enabled`` e.g. by using ``ln -s /etc/apache2/sites-available/akplanning.conf /etc/apache2/sites-enabled/akplanning.conf``.
or create a new config (.conf) file (similar to ``apache-akplanning.conf``) replacing $SUBDOMAIN with the subdomain the system should be available under, and $MAILADDRESS with the e-mail address of your administrator and $PATHTO with the appropriate paths. Copy or symlink it to ``/etc/apache2/sites-available``. Then symlink it to ``sites-enabled`` e.g. by using ``ln -s /etc/apache2/sites-available/akplanning.conf /etc/apache2/sites-enabled/akplanning.conf``.
1. restart Apache ``sudo systemctl restart apache2.service``
1. create a dedicated user, e.g. ``adduser django``
1. transfer ownership of the folder to the new user ``chown -R django:django /srv/WannaDB``
......
......@@ -19,3 +19,30 @@
RewriteCond %{SERVER_NAME} =$SUBDOMAIN
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName $SUBDOMAIN
ServerAdmin $MAILADDRESS
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /srv/AKPlanning/static
<Directory /srv/AKPlanning/static>
Require all granted
</Directory>
ProxyPassMatch ^/static/ !
ProxyPass / uwsgi://127.0.0.1:3035/
ProxyPassReverse / uwsgi://127.0.0.1:3035/
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile $PATHTOfullchain.pem
SSLCertificateKeyFile $PATHTOprivkey.pem
</VirtualHost>
</IfModule>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment