python - launch tornado app on port 80 on remote server -
i have flask app wrapped in tornado server , trying run app on remote server when got error:
traceback (most recent call last): file "run.py", line 7, in <module> server.listen(80) file "/home/ec2-user/gatekeeper/local/lib/python2.7/site-packages/tornado/tcpserver.py", line 126, in listen sockets = bind_sockets(port, address=address) file "/home/ec2-user/gatekeeper/local/lib/python2.7/site-packages/tornado/netutil.py", line 187, in bind_sockets sock.bind(sockaddr) file "/usr/lib64/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) socket.error: [errno 13] permission denied
so tried use sudo
, got this:
traceback (most recent call last): file "run.py", line 1, in <module> tornado.wsgi import wsgicontainer importerror: no module named tornado.wsgi
so wondering if must install tornado root in turn mean virtualenv
practically useless.
how launching app , interacting virtualenv? sudo removes environment variables, deactivate "activated" virtualenv. if using source $env/bin/activate
, need after sudo
. or can avoid using activate
running virtualenv's python executable: sudo $env/bin/python run.py
.
Comments
Post a Comment