2

I have a flask app running on port 5000 but that port is blocked on my server and I can't unblock it. Ideally I'd like to just run the app on www.mywebsite.com/flaskapp, is this possible by just configuring apache2? The rest of the server is essentially a wordpress website and I'd like to not destroy that to run this flask app.

1 Answer 1

1

I assume you're using mod_wsgi on Apache2.

If you have a graphing app you only want to run on /graph, add this to your virtual host config:

WSGIScriptAlias /graph /var/www/graph/graph.wsgi

Navigating to /graph and it'll run the .wsgi you've written for it.

3
  • Do I not need to put that as a separate site with a seperate conf file?
    – Craggles
    Aug 26, 2016 at 17:44
  • What would the graph.wsgi file look like?
    – Craggles
    Aug 27, 2016 at 8:02
  • For a flask web app, it's just importing your python code for it. The standard implementation being: "from graph import graph_app as application" The config goes in whichever virtual host you're configuring the app for.
    – L Martin
    Aug 28, 2016 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.