Running django and flask on same apache server

前端 未结 2 778
感情败类
感情败类 2021-01-17 17:59

I am trying to run to run django and flask on the same apache server.

WSGISocketPrefix /var/www/wsgi

        ServerAdmin name@email.         


        
相关标签:
2条回答
  • 2021-01-17 18:16

    I'm not sure if this would solve the problem, but have you tried changing the order of your script alias so that /app1 is found before / ?

    WSGISocketPrefix /var/www/wsgi
    <VirtualHost *:80>
            ServerAdmin name@email.com
            ServerName  domain.com
            ServerAlias www.domain.com
            DocumentRoot /var/www/
            LogLevel warn
            WSGIDaemonProcess apache processes=2 maximum-requests=500 threads=1
            WSGIProcessGroup apache
            Alias /media /var/www/media/
            WSGIScriptAlias /app1 /var/www/flaskapps/app.wsgi
            WSGIScriptAlias / /var/www/djangoapps/django.wsgi
    
    </VirtualHost>
    
    0 讨论(0)
  • 2021-01-17 18:35

    For anyone who want to achieve the same in 2018 this really helped me:

    https://www.phusionpassenger.com/library/deploy/apache/deploy/python/

    I know it is off topic, but I found this question like 20 searches before I found the link to the Description from Passenger....

    How ev's here is an excert from the tutorial:

    <VirtualHost *:80>
        ServerName www.phusion.nl
        DocumentRoot /websites/phusion/public
    <Directory /websites/phusion>
        Allow from all
        Options -MultiViews
        # Uncomment this if you're on Apache >= 2.4:
        #Require all granted
    </Directory>
    
    Alias /subapp /websites/secondapp/public
    <Location /subapp>
        PassengerBaseURI /subapp
        PassengerAppRoot /websites/secondapp
    
        PassengerAppType wsgi
        PassengerStartupFile passenger_wsgi.py
    </Location>
    <Directory /websites/secondapp/public>
        Allow from all
        Options -MultiViews
        # Uncomment this if you're on Apache >= 2.4:
        #Require all granted
    </Directory>
    

    0 讨论(0)
提交回复
热议问题