I ran into a problem. I have a python script. You can call it a CGI script. It works fine under Apache2, but there is only one left before I turn off the system, which works forever. The new system uses nginx. I configured uwsgi, as many suggested when searching for a solution, configured a virtual host for this script to run. I used the first example in the uwsgi wiki to confirm that I configured nginx correctly and that it can communicate with uwsgi. Worked like a charm.
Now my complications:
My script was written some time ago and is not intended for WSGI, and I do not want / cannot rewrite it.
So, I installed the cgi module for uwsgi and tried to use it. All I get is 502 errors. Nothing runs uwsgi.
Here is my configuration that I use for this application:
[uwsgi]
plugins = cgi
socket = 127.0.0.1:9010
cgi = /=/usr/share/test/
cgi-allowed-ext = .py
cgi-helper = .py=python
Here is the code I have in index.py (test script):
#!/usr/bin/python
print "Content-type: text/html\n\n"
print "<html><body><h1>It works!</h1></body></html>"
I am trying to verify uwsgi with the following command:
/usr/sbin/uwsgi
And here is the output that I get:
[uWSGI] getting INI configuration from /etc/uwsgi/test.ini
*** Starting uWSGI 1.1.2 (64bit) on [Fri Apr 20 15:26:33 2012] ***
compiled with version: 4.4.6 20110731 (Red Hat 4.4.6-3) on 19 April 2012 15:09:37
current working directory: /home/user
detected binary path: /usr/sbin/uwsgi
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread mutexes
uWSGI http bound on :9011 fd 3
uwsgi socket 0 bound to TCP address 127.0.0.1:9010 fd 6
your server socket listen backlog is limited to 100 connections
*** Operational MODE: single process ***
initialized CGI mountpoint: / = /usr/share/test/
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 6727)
spawned uWSGI worker 1 (pid: 6728, cores: 1)
spawned uWSGI http 1 (pid: 6729)
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
-- unavailable modifier requested: 0 --
Where is the problem? Please, help.
Thanks in advance.
sashk source
share