Actually I figured it out, my config was missing -

NameVirtualHost *:80

After adding that, the virtual hosts are getting called correctly.

Thanks and Cheers!

On Sunday, August 13, 2017 at 12:16:21 AM UTC-4, [email protected] wrote:
>
> Also, I checked the blog link below but that is a little different. Both 
> the URLs used in there end with the same domain address (e.g. example.com). 
> My case is a little different as both the URLs have different domain 
> addresses. Not sure if that matters?
>
> On Saturday, August 12, 2017 at 8:49:43 PM UTC-4, Graham Dumpleton wrote:
>>
>> For general advice see:
>>
>> http://blog.dscpl.com.au/2012/10/requests-running-in-wrong-django.html
>>
>> See further comments below.
>>
>> On 13 Aug 2017, at 9:45 am, <[email protected]> <[email protected]> 
>> wrote:
>>
>> Hello,
>>
>> I am trying to setup two virtual hosts pertaining to two websites - lets 
>> call them www.A.com and www.B.com using apache, mod_wsgi daemon. Both 
>> the apps are written using flask.
>>
>> Below is my apache conf file and for some reason it always picks the 
>> first declared virtual host URL and executes the first flask application 
>> for both URLs.
>>
>>
>> What are the URLs you are using?
>>
>> Does the hostname in the URL match exactly what you are setting 
>> ServerName to?
>>
>> I am still new to the mod_wsgi scene and was reading multiple virtual 
>> hosts setup instructions from here - 
>> http://modwsgi.readthedocs.io/en/develop/user-guides/configuration-guidelines.html
>>
>> Any idea how to get both of them working? The apache server is run as 
>> root.
>>
>> Conf:
>> WSGIPythonHome /usr/local/venvs/myenv
>>
>> <VirtualHost *:80>
>>   ServerName www.A.com
>>
>>   WSGIDaemonProcess www.A.com threads=15 maximum-requests=10000
>>
>>   WSGIScriptAlias / /var/www/A/A.wsgi
>>   WSGIProcessGroup www.A.com
>>
>>   <Directory /var/www/Ar>
>>     Order allow,deny
>>     Allow from all
>>   </Directory>
>>
>> </VirtualHost>
>>
>> <VirtualHost *:80>
>>   ServerName www.B.com
>>
>>   WSGIDaemonProcess www.B.com threads=15 maximum-requests=10000
>>
>>   WSGIScriptAlias / /var/www/B/B.wsgi
>>   WSGIProcessGroup www.Bl.com
>>
>>
>> Do you mean www.B.com here. Not www.BI.com?
>>
>>
>>   <Directory /var/www/B>
>>     Order allow,deny
>>     Allow from all
>>   </Directory>
>>
>> </VirtualHost>
>>
>> Thanks,
>> RM
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "modwsgi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/modwsgi.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to