Good morning, I'm trying to enable two Django Websites in my server but I can not make it work, I have only one subdomain and both sites should work from it.
The problem is that when I activate site's 1 virtualhost I can see it perfectly, but when I activate the site's 2 virtualhost I can only see site 2, and then when I try to see site 1 it shows the apache2 default page.
Below is my config
My site 1 is the root.
聽聽聽聽聽聽聽
Site 1 VirtualHost<IfModule mod_ssl.c>
聽聽聽 <VirtualHost *:443>
聽聽聽聽聽聽聽 ServerAdmin webmaster@localhost
聽聽聽聽聽聽聽 #DocumentRoot /var/www/html
聽聽聽聽聽聽聽 ErrorLog ${APACHE_LOG_DIR}/error.log
聽聽聽聽聽聽聽 CustomLog ${APACHE_LOG_DIR}/access.log combined
聽聽聽聽聽聽聽 #聽聽 SSL Engine Switch:
聽聽聽聽聽聽聽 #聽聽 Enable/Disable SSL for this virtual host.
聽聽聽聽聽聽聽 SSLEngine on
聽聽聽聽聽聽聽 #聽聽 A self-signed (snakeoil) certificate can be created by installing
聽聽聽聽聽聽聽 #聽聽 the ssl-cert package. See
聽聽聽聽聽聽聽 #聽聽 /usr/share/doc/apache2/README.Debian.gz for more info.
聽聽聽聽聽聽聽 #聽聽 If both key and certificate are stored in the same file, only the
聽聽聽聽聽聽聽 #聽聽 SSLCertificateFile directive is needed.
聽聽聽聽聽聽聽 SSLCertificateFile /etc/letsencrypt/route to my certificate
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 SSLCertificateKeyFile /etc/letsencrypt/route to my certificate
聽聽聽聽聽聽
聽聽聽聽聽聽聽 #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
聽聽聽聽聽聽聽 <FilesMatch "\.(cgi|shtml|phtml|php)$">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 SSLOptions +StdEnvVars
聽聽聽聽聽聽聽 </FilesMatch>
聽聽聽聽聽聽聽 <Directory /usr/lib/cgi-bin>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 SSLOptions +StdEnvVars
聽聽聽聽聽聽聽 </Directory>
聽聽聽聽聽聽聽 #Prestashop
聽聽聽聽聽聽聽 alias /prestashop /var/www/html/prestashop
聽聽聽聽聽聽聽 <Directory /var/www/html/prestashop>
聽聽聽聽聽聽聽聽聽聽聽 Require all granted
聽聽聽聽聽聽聽 </Directory>
聽聽聽聽聽聽
聽聽聽聽聽聽聽 #My website
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 alias /static /route to my static folder/static
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <Directory /route to my static folder/static>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Require all granted
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </Directory>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <Directory /route to my wsgi.py folder>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <Files wsgi.py>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Require all granted
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </Files>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </Directory>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 WSGIDaemonProcess site python-path=/pathtomanage.pyfolder python-home=/pathtothevenvfolder
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 WSGIProcessGroup site
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 WSGIScriptAlias / /home/dostow/dostowsite/webcode/webcode/wsgi.py application-group=%{GLOBAL}
聽聽聽 </VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
聽聽聽聽聽聽聽聽聽聽聽聽聽聽
聽 Site 2 VirtualHost<IfModule mod_ssl.c>
聽聽聽 <VirtualHost *:443>
聽聽聽聽聽聽聽 ServerAdmin webmaster@localhost
聽聽聽聽聽聽聽 ErrorLog ${APACHE_LOG_DIR}/error.log
聽聽聽聽聽聽聽 CustomLog ${APACHE_LOG_DIR}/access.log combined
聽聽聽聽聽聽聽 #聽聽 SSL Engine Switch:
聽聽聽聽聽聽聽 #聽聽 Enable/Disable SSL for this virtual host.
聽聽聽聽聽聽聽 SSLEngine on
聽聽聽聽聽聽聽 #聽聽 A self-signed (snakeoil) certificate can be created by installing
聽聽聽聽聽聽聽 #聽聽 the ssl-cert package. See
聽聽聽聽聽聽聽 #聽聽 /usr/share/doc/apache2/README.Debian.gz for more info.
聽聽聽聽聽聽聽 #聽聽 If both key and certificate are stored in the same file, only the
聽聽聽聽聽聽聽 #聽聽 SSLCertificateFile directive is needed.
聽聽聽聽聽聽聽 SSLCertificateFile /etc/letsencrypt/live/route to my certificate
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 SSLCertificateKeyFile /etc/letsencrypt/live/route to my certificate
聽聽聽聽聽聽聽 #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
聽聽聽聽聽聽聽 <FilesMatch "\.(cgi|shtml|phtml|php)$">
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 SSLOptions +StdEnvVars
聽聽聽聽聽聽聽 </FilesMatch>
聽聽聽聽聽聽聽 <Directory /usr/lib/cgi-bin>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 SSLOptions +StdEnvVars
聽聽聽聽聽聽聽 </Directory>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽
聽聽聽聽聽聽聽 #AAVVMARESME
聽聽聽聽聽聽聽 alias /site2/static /route to my static folder/static
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <Directory /route to my static folder/static>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Require all granted
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </Directory>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <Directory /route to my wsgi.py folder>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 <Files wsgi.py>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Require all granted
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </Files>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 </Directory>
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 WSGIDaemonProcess site2 python-path=/pathtomanage.pyfolder python-home=/pathtothevenvfolder
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 WSGIProcessGroup site2
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 WSGIScriptAlias /site2 /route to my wsgi.py folder/wsgi.py application-group=%{GLOBAL}
聽聽聽 </VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
i would appreciate your help!!