python - Deploying Bottle App with AWS -


i wanted know how deploy app developed using bottle framework in aws.

i created ec2 instance, deployed app in environment - linux python 2.7 64 bit. have main file application.py , run framework using bottle.run(host='0.0.0.0")

i following exception (error.log)

[sun jun 14 16:15:08.989733 2015] [:error] [pid 2400] mod_wsgi (pid=2400): target wsgi script '/opt/python/current/app/application.py' cannot loaded python module. [sun jun 14 16:15:08.989884 2015] [:error] [pid 2400] mod_wsgi (pid=2400): exception occurred processing wsgi script '/opt/python/current/app/application.py'. [sun jun 14 16:15:08.989922 2015] [:error] [pid 2400] traceback (most recent call last): [sun jun 14 16:15:08.989954 2015] [:error] [pid 2400]   file "/opt/python/current/app/application.py", line 31, in <module> [sun jun 14 16:15:08.990035 2015] [:error] [pid 2400]     bottle.run(host='0.0.0.0', port=80) [sun jun 14 16:15:08.990059 2015] [:error] [pid 2400]   file "/opt/python/run/venv/lib/python2.7/site-packages/bottle.py", line 3117, in run [sun jun 14 16:15:08.990094 2015] [:error] [pid 2400]     server.run(app) [sun jun 14 16:15:08.990114 2015] [:error] [pid 2400]   file "/opt/python/run/venv/lib/python2.7/site-packages/bottle.py", line 2771, in run [sun jun 14 16:15:08.990144 2015] [:error] [pid 2400]     srv = make_server(self.host, self.port, app, server_cls, handler_cls) [sun jun 14 16:15:08.990164 2015] [:error] [pid 2400]   file "/usr/lib64/python2.7/wsgiref/simple_server.py", line 151, in make_server [sun jun 14 16:15:08.990197 2015] [:error] [pid 2400]     server = server_class((host, port), handler_class) [sun jun 14 16:15:08.990217 2015] [:error] [pid 2400]   file "/usr/lib64/python2.7/socketserver.py", line 420, in __init__ [sun jun 14 16:15:08.990250 2015] [:error] [pid 2400]     self.server_bind() [sun jun 14 16:15:08.990271 2015] [:error] [pid 2400]   file "/usr/lib64/python2.7/wsgiref/simple_server.py", line 48, in server_bind [sun jun 14 16:15:08.990299 2015] [:error] [pid 2400]     httpserver.server_bind(self) [sun jun 14 16:15:08.990319 2015] [:error] [pid 2400]   file "/usr/lib64/python2.7/basehttpserver.py", line 108, in server_bind [sun jun 14 16:15:08.990347 2015] [:error] [pid 2400]     socketserver.tcpserver.server_bind(self) [sun jun 14 16:15:08.990367 2015] [:error] [pid 2400]   file "/usr/lib64/python2.7/socketserver.py", line 434, in server_bind [sun jun 14 16:15:08.990394 2015] [:error] [pid 2400]     self.socket.bind(self.server_address) [sun jun 14 16:15:08.990414 2015] [:error] [pid 2400]   file "/usr/lib64/python2.7/socket.py", line 224, in meth [sun jun 14 16:15:08.990442 2015] [:error] [pid 2400]     return getattr(self._sock,name)(*args) [sun jun 14 16:15:08.990475 2015] [:error] [pid 2400] error: [errno 13] permission denied 

can let me know i'm going wrong.

as far now, need root access bind port 80. try running

sudo ./application.py

or can change port number 8080 or similar.

if deploying production, suggest reading more on bottlepy docs:

http://bottlepy.org/docs/dev/deployment.html#server-options

hope helps. cheers.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -