We are trying to run 2 different flask applications with different domain names from same server using mod_wsgi + Apache2.
This is the settings configured in httpd.conf
# For www.yyy.com
WSGIDaemonProcess yyy python-path=/var/www/yyy
WSGIScriptAlias / /var/www/yy/wsgi.py process-group=yyy application-group=%{GLOBAL}
# For www.zzz.com
WSGIDaemonProcess zzz python-path=/var/www/zzz
WSGIScriptAlias / /var/www/zzz/wsgi.py process-group=zzz application-group=%{GLOBAL}
and created /etc/httpd/conf.d/yyy.conf & zzz.conf similar to
<VirtualHost *:80>
ServerName www.yyy.com
ServerAdmin joel
DocumentRoot /var/www/yyy
ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/access.log combined
Alias /static /var/www/yyy/static
<Directory /var/www/yyy/static>
Require all granted
</Directory>
<Directory /var/www/yyy>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
but whatever we try we end up getting only first application that is configured in httpd.conf.
My query was answered by Graham Dumpleton, mod_wsgi mailing list. He asked me to remove all mod_wsgi settings from httpd.conf and move them in virtualhost config file /etc/httpd/conf.d/yyy.conf and zzz.conf as