Adding a Django site breaks my virtual hosts on CentOS 7
0
votes
1
answer
395
views
I have a **CentOS 7 server** with about 20 domains all managed automatically with a **vhosts file in /etc/httpd/conf.d**.
I am trying to learn **Django** and wanted to set up a single domain using it, so I added a specific virtualhost to the .conf file.
The result is that the Django domain works fine but **all the other sites are broken** (try to use Django but cause errors).
The Django domain has **two folders:** **djangodomain.com** for static files and **djangodomain.app** for the Python files.
**How can I integrate a single Django domain into my existing many-domain virtual host setup?**
Existing vhosts.conf:
serveradmin username@domain.com
serveradmin username@domain.com
usecanonicalname off
# www.site.com » site.com
rewriteengine on
rewritecond %{HTTP_HOST} ^www\.(.*)$ [nc]
rewriterule ^(.*)$ http://%1 [r=301,l]
# file locations
virtualdocumentroot "/home/username/%0"
allowoverride all
require all granted
options indexes followsymlinks
options +execcgi
options +includes
What I added that broke all but the Django site:
ServerName djangodomain.com
ServerAlias www.djangodomain.com
ServerAdmin user@domain.com
DocumentRoot /home/username/djangodomain.com
WSGIScriptAlias / /home/username/djangodomain.app/django.wsgi
Order allow,deny
Allow from all
Alias /robots.txt /home/username/djangodomain.com/robots.txt
Alias /favicon.ico /home/username/djangodomain.com/favicon.ico
Alias /images /home/username/djangodomain.com/images
Alias /static /home/username/djangodomain.com/static
ErrorLog /home/username/djangodomain.logs/error.log
CustomLog /home/username/djangodomain.logs/access.log combined
[update: problem solved] Crossposted to Stack Exchange
Asked by Andrew Swift
(103 rep)
Oct 21, 2016, 07:00 PM
Last activity: Oct 24, 2016, 02:02 PM
Last activity: Oct 24, 2016, 02:02 PM