I am trying to set up SSL on a Django site I maintain and having a bit of trouble setting up my VirtualHost with SSL. I followed the instructions here but every time I try to restart apache, it tells me it cannot restart because of multiple virtualhosts usign the same wsgi config:
/etc/init.d/apache2 reload
Syntax error on line 33 of /etc/apache2/sites-enabled/www.mydomain.com:
Name duplicates previous WSGI daemon definition.
...fail!
I understand what is happening, just not how to fix it. Any suggestions are appreciated, thanks! Here is what my VirutalHosts file looks like:
<VirtualHost *:80>
ServerAdmin my@email.com
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot /sites/mydomain
# WSGI Settings
WSGIScriptAlias / /sites/mydomain/wsgi_handler.py
WSGIDaemonProcess mydomain user=myuser group=mygroup processes=1 threads=1
WSGIProcessGroup mydomain
# Static Directories
Alias /static /sites/mydomain/static/
<Location "/static">
SetHandler None
</Location>
Alias /img /sites/mydomain/img/
<Location "/img">
SetHandler None
</Location>
</VirtualHost>
<VirtualHost *:443>
ServerAdmin my@email.com
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot /sites/mydomain
# WSGI Settings
WSGIScriptAlias / /sites/mydomain/wsgi_handler.py
WSGIDaemonProcess mydomain user=myuser group=mygroup processes=1 threads=1
WSGIProcessGroup mydomain
# Static Directories
Alias /static /sites/mydomain/static/
<Location "/static">
SetHandler None
</Location>
Alias /img /sites/mydomain/img/
<Location "/img">
SetHandler None
</Location>
# SSL Stuff
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/crt/vhost1.crt
SSLCertificateKeyFile /etc/apache2/ssl/key/vhost1.key
<Location />
SSLRequireSSL On
SSLVerifyClient optional
SSLVerifyDepth 1
SSLOptions +StdEnvVars +StrictRequire
</Location>
</VirtualHost>