-
-
Save brianjking/75a26dcd2a2f52d1b3ba to your computer and use it in GitHub Desktop.
Apache + Django config
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
WSGIPythonPath /var/www/domain.com/project | |
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
ServerName domain.com | |
ServerAlias www.domain.com | |
DocumentRoot /var/www/domain.com/project/ | |
WSGIScriptAlias / /var/www/domain.com/project/project/wsgi.py | |
#WSGIPythonPath /var/www/domain.com/project | |
Alias /static /var/www/domain.com/project/static | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC] | |
RewriteRule ^(.*)$ http://domain.com$1 [R=301,L] | |
<Directory /var/www/domain.com/project/static> | |
Options -Indexes | |
Require all granted | |
</Directory> | |
<Directory /var/www/domain.com/project/project> | |
<Files wsgi.py> | |
Require all granted | |
</Files> | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
# Possible values include: debug, info, notice, warn, error, crit, | |
# alert, emerg. | |
LogLevel warn | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment