Skip to content

Instantly share code, notes, and snippets.

@sujeetkv
Created April 23, 2020 11:38
Show Gist options
  • Save sujeetkv/30f6213b88b3298f8c0e3c0812e29758 to your computer and use it in GitHub Desktop.
Save sujeetkv/30f6213b88b3298f8c0e3c0812e29758 to your computer and use it in GitHub Desktop.
Django Apache Server Example
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
ServerAdmin [email protected]
DocumentRoot /path/to/example-site/app/app/web/static
Alias /robots.txt /path/to/example-site/app/app/web/static/robots.txt
Alias /favicon.ico /path/to/example-site/app/app/web/static/favicon.ico
Alias /uploads/ /path/to/example-site/app/app/web/static/uploads/
<Directory /path/to/example-site/app/app/web/static>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
WSGIDaemonProcess example.com processes=2 threads=15 display-name=%{GROUP} python-home=/path/to/example-site/venv python-path=/path/to/example-site/app
WSGIProcessGroup example.com
WSGIScriptAlias / /path/to/example-site/app/app/wsgi.py process-group=example.com
WSGIPassAuthorization On
<Directory /path/to/example-site/app/app>
<Files wsgi.py>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Files>
</Directory>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment