Created
August 13, 2018 17:54
-
-
Save MksYi/bb0af7e2b88702faab5423297eca517e to your computer and use it in GitHub Desktop.
Django + Apache2.4 + SSL conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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/wsgi.py | |
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> | |
<Directory /home/<User_Name>/MyProject/MyProject> | |
<Files wsgi.py> | |
Order deny,allow | |
# 限制所有人存取 包括本機 | |
Require all denied | |
# 開放所有人存取 | |
# Allow from all | |
# 開放本機器存取 | |
Require ip 127.0.0.1 | |
# 開放其他 IP 或 網段存取 | |
# Require 10.0.0.1 192.168 172 | |
</Files> | |
</Directory> | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment