I have a Flask server running over port 5000, and that's fine. I can access it at http://example.com//000
But is it possible to simply access it at http://example.com ? I assume that this means that I should change the port from 5000 to 80. But when I try to do this on Flask, I get this error message at startup.
Traceback (most recent call last): File "xxxxxx.py", line 31, in <module> app.run(host="0.0.0.0", port=int("80"), debug=True) File "/usr/local/lib/python2.6/dist-packages/flask/app.py", line 772, in run run_simple(host, port, self, **options) File "/usr/local/lib/python2.6/dist-packages/werkzeug/serving.py", line 706, in run_simple test_socket.bind((hostname, port)) File "<string>", line 1, in bind socket.error: [Errno 98] Address already in use
Running lsof -i :80 returns
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME apache2 467 root 3u IPv4 92108840 0t0 TCP *:www (LISTEN) apache2 4413 www-data 3u IPv4 92108840 0t0 TCP *:www (LISTEN) apache2 14346 www-data 3u IPv4 92108840 0t0 TCP *:www (LISTEN) apache2 14570 www-data 3u IPv4 92108840 0t0 TCP *:www (LISTEN) apache2 14571 www-data 3u IPv4 92108840 0t0 TCP *:www (LISTEN) apache2 14573 www-data 3u IPv4 92108840 0t0 TCP *:www (LISTEN)
Do I need to kill these processes first? It's safe? Or is there another way to keep Flask running on port 5000, but somehow redirect the main domain of the site?
python flask networking port
quantumtremor Nov 26 '13 at 9:22 2013-11-26 09:22
source share