I have two Django projects running on the same server, accessed by two different domains, both of which use the HTTPS provided by Let Encrypt. Both of them work, and I can access them from https://foo.com or https://bar.com . If I go to foo.com, it redirects to https://foo.com ; but for bar.com it redirects to https://foo.com too.
I have two .conf files that look like this:
<VirtualHost *:80> ServerName foo.com ServerAlias www.foo.com </VirtualHost> <VirtualHost *:443> ServerName foo.com ServerAlias www.foo.com Alias /static /var/www/html/foo <Directory /var/www/foo/static> Require all granted </Directory> <Directory /path/to/foo> <Files wsgi.py> Require all granted </Files> </Directory> WSGIDaemonProcess foo.com python-home=/path/to/venv/foo python-path=/path/to/ WSGIProcessGroup foo.com WSGIScriptAlias / /path/to/foo/wsgi.py RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] SSLCertificateFile /etc/letsencrypt/live/foo.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/foo.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost>
And the other is almost the same, but for "bar", where ever is "foo". Both have their own virtual and settings. My /etc/apache2/sites-enabled has only these two files: foo.com.conf and bar.com.conf .
For SSL, I used:
sudo letsencrypt --apache -d foo.com -d www.foo.com
and
sudo letsencrypt --apache -d bar.com -d www.bar.com
When you start the second one, it shows this error: Name duplicates previous WSGI daemon definition.
Any idea on what's wrong?
source share