0

Running simple python site

Andrey Yatsuk 9 років тому 0

Hi! I make new site at '/var/www/startpage.yatsukav.com/public_html'

In 'public_html' folder i put index.py:

#!/usr/bin/env python3


print("Content-type: text/html")

print()

print("<h1>Hello world!</h1>")

Here website settings:

Image 123

Image 124


So i see this (gunicorn python-wsgi-0 Exited too quickly):

Image 126

At site domain 502 Bad Gateway page. Public_html folder has index.pyc.


gunicorn has no logs.

Log startpageyatsukavcom-python-wsgi-0-stdout---supervisor-POiIzw.log is empty.

Log startpageyatsukavcom-python-wsgi-0-stderr---supervisor-S2IXVe.log has:

2015-12-25 08:19:54 [10577] [INFO] Starting gunicorn 17.5

2015-12-25 08:19:54 [10577] [INFO] Listening at: unix:/var/run/ajenti-v-gunicorn-startpageyatsukavcom-python-wsgi-0.sock (10577)
2015-12-25 08:19:54 [10577] [INFO] Using worker: sync
2015-12-25 08:19:54 [10582] [INFO] Booting worker with pid: 10582
2015-12-25 08:19:54 [10582] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 473, in spawn_worker
worker.init_process()
File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 100, in init_process
self.wsgi = self.app.wsgi()
File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 115, in wsgi
self.callable = self.load()
File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 33, in load
return util.import_app(self.app_uri)
File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 362, in import_app
__import__(module)
ImportError: No module named index
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 473, in spawn_worker
worker.init_process()
File "/usr/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 100, in init_process
self.wsgi = self.app.wsgi()
File "/usr/lib/python2.7/dist-packages/gunicorn/app/base.py", line 115, in wsgi
self.callable = self.load()
File "/usr/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 33, in load
return util.import_app(self.app_uri)
File "/usr/lib/python2.7/dist-packages/gunicorn/util.py", line 362, in import_app
__import__(module)
ImportError: No module named index

Log supervisord.log has:

2015-12-25 08:04:33,949 CRIT Supervisor running as root (no user in config file)

2015-12-25 08:04:33,949 INFO RPC interface 'supervisor' initialized
2015-12-25 08:04:33,950 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2015-12-25 08:04:33,950 INFO supervisord started with pid 3962
2015-12-25 08:04:34,023 INFO spawned: 'startpageyatsukavcom-python-wsgi-0' with pid 10223
2015-12-25 08:04:34,193 INFO exited: startpageyatsukavcom-python-wsgi-0 (exit status 1; not expected)
2015-12-25 08:04:35,195 INFO spawned: 'startpageyatsukavcom-python-wsgi-0' with pid 10249
2015-12-25 08:04:35,513 INFO exited: startpageyatsukavcom-python-wsgi-0 (exit status 1; not expected)
2015-12-25 08:04:37,515 INFO spawned: 'startpageyatsukavcom-python-wsgi-0' with pid 10259
2015-12-25 08:04:37,676 INFO exited: startpageyatsukavcom-python-wsgi-0 (exit status 1; not expected)
2015-12-25 08:04:40,680 INFO spawned: 'startpageyatsukavcom-python-wsgi-0' with pid 10269
2015-12-25 08:04:40,945 INFO exited: startpageyatsukavcom-python-wsgi-0 (exit status 1; not expected)

2015-12-25 08:04:41,945 INFO gave up: startpageyatsukavcom-python-wsgi-0 entered FATAL state, too many start retries too quickly


VDS is new. Clean Ubuntu 14.04 x86 + Ajenti + Ajenti V. I am absolutely newbie in python, so it is my first step. Please help me.