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!!