Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Django + Apache2.4 + SSL conf
<VirtualHost *:443>
ErrorLog /home/<User_Name>/MyProject/logs/error.log
CustomLog /home/<User_Name>/MyProject/logs/access.log combined
WSGIScriptAlias / /home/<User_Name>/MyProject/MyProject/
Alias /static/ /home/<User_Name>/MyProject/static/
Alias /templates/ /home/<User_Name>/MyProject/templates/
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
<Directory /home/<User_Name>/MyProject>
Options FollowSymLinks
Order deny,allow
Require all granted
<Directory /home/<User_Name>/MyProject/MyProject>
Order deny,allow
# 限制所有人存取 包括本機
Require all denied
# 開放所有人存取
# Allow from all
# 開放本機器存取
Require ip
# 開放其他 IP 或 網段存取
# Require 192.168 172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment