Home > Blockchain >  How can i run flask wsgi app with apache on port :5000
How can i run flask wsgi app with apache on port :5000

Time:04-13

I am trying to deploy flask app like api on :5000 port(returning jsons). What am i doing wrong?(it is not working).

My .conf file:

<VirtualHost *:5000>
        ServerAdmin webmaster@localhost

        WSGIDaemonProcess flaskapp threads=5
        WSGIScriptAlias / /var/www/html/photochooser/app.wsgi
        WSGIApplicationGroup %{GLOBAL}
        <Directory flaskapp>
             WSGIProcessGroup flaskapp
             WSGIApplicationGroup %{GLOBAL}
             Order deny,allow
             Allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Then im typing a2ensite ....conf, restarting apache And ip:5000 returning "Page not found"

P.S. its working on :80, but i need this port for my react client side.

CodePudding user response:

Found solution by myself:

Edited /etc/apache2/ports.conf: Added ''' Listen 5000 '''

And then ip:5000 started working :)

  • Related