Здравствуйте. Нужно запускать скрипты на python через веб-интерфейс. Связка nginx + uwsgi, устанавливал через
aptitude install nginx uwsgi uwsgi-plugin-python
Конфиги такие:
root@vm6097:~# cat /etc/nginx/sites-available/default
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts
server {
listen 80; ## listen for ipv4
#listen [::]:80 default ipv6only=on; ## listen for ipv6
server_name localhost;
access_log /var/log/nginx/localhost.access.log;
root /var/www/;
location / {
access_log off;
index index.html index.php;
}
location ~ \.py$ {
uwsgi_pass 127.0.0.1:8012;
include uwsgi_params;
root /home/quux/python/letmedraw_com;
}
}
Конфиг uWSGI:
root@vm6097:~# cat /etc/uwsgi/apps-available/letmedraw_com.ini
[uwsgi]
plugins = python_plugin
#plugins = python
virtualenv = /home/quux/envs/letmedraw_com/
chdir = /home/quux/python/letmedraw_com/
pythonpath = ..
env = DJANGO_SETTINGS_MODULE=example.settings
module = django.core.handlers.wsgi:WSGIHandler()
touch-reload = /home/quux/python/example/touchme
#socket = unix:///home/quux/python/letmedraw_com/uwsgi.sock
socket = 127.0.0.1:8012
Выдает в браузер:
uWSGI Error
Python application not found
Логи uWSGI:
root@vm6097:~# tail /var/log/uwsgi/app/letmedraw_com.log
[pid: 11782|app: -1|req: -1/5] 2.135.172.194 () {40 vars in 728 bytes} [Sun Mar 11 23:31:11 2012] GET /test.py => generated 48 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
[pid: 11782|app: -1|req: -1/6] 2.135.172.194 () {40 vars in 728 bytes} [Sun Mar 11 23:31:11 2012] GET /test.py => generated 48 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
Sun Mar 11 23:31:11 2012 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /test.py (ip 2.135.172.194) !!!
Sun Mar 11 23:31:11 2012 - write(): Broken pipe [proto/uwsgi.c line 138] during GET /test.py (2.135.172.194)
Sun Mar 11 23:31:11 2012 - SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request /test.py (ip 2.135.172.194) !!!
Sun Mar 11 23:31:11 2012 - write(): Broken pipe [proto/uwsgi.c line 138] during GET /test.py (2.135.172.194)
[pid: 11783|app: -1|req: -1/7] 2.135.172.194 () {40 vars in 728 bytes} [Sun Mar 11 23:31:11 2012] GET /test.py => generated 0 bytes in 1 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
Сам файл test.py:
root@vm6097:~# cat /home/quux/python/letmedraw_com/test.py
#!/usr/bin/python
print 'hello'
Подскажите плиз что нужно поправить, чтобы браузер получал output из test.py?