OLS will not run a simple hello world wsgi python script

#1
https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:other-ext-apps:python-lsapi
https://openlitespeed.org/kb/python-wsgi-applications/

I followed these guides and tried to run the hello.wsgi example linked to above without success. I get a "503 service unavailable" error every time. My VPS only has 256MB of RAM and half is already being used so it could be a RAM limitation I guess, but I am not sure. Anyone want to help me troubleshoot this? I just got a VPS with 1 gig of RAM. So if it is a RAM problem hopefully that will fix it. I will try installing OLS on that server soon. I attached my error log.

OLS is my favorite web server and I really want to use it. So if no one can help me with this I will try to script with Lua instead of Python but if I cannot get that to work then I think I will try out openresty with lua scripting and if I can't get that to work then maybe H20 with Ruby or OLS with Ruby or PHP. As far as PHP goes it is my least favorite choice and it isn't very practical for me because it doesn't seem to have had a good FFI interface for C functions until just now with the release of 7.4. I really need to be able to call c functions without it being herculean as it appears to be in older versions at least since dl() was deprecated. If this is a memory problem then maybe Lua will use less memory, but I can also switch to my new 1 gig VPS.

This is from my conf file:
extprocessor wsgi_app {
type lsapi
address uds://tmp/lshttpd/lswsgi.sock
maxConns 32
initTimeout 60
retryTimeout 60
persistConn 0
respBuffer 0
autoStart 2
path /usr/local/lsws/fcgi-bin/lswsgi
backlog 1
instances 32
extMaxIdleTime 60
memSoftLimit 32
memHardLimit 64
procSoftLimit 32
procHardLimit 64

scripthandler {
add lsapi:wsgi_app py

I tried to run the wsgi.py 'hello world' file from many different locations but it never runs.
 

Attachments

#3
That was not my entire conf file. I just pasted the bits I thought might be relevant. Maybe I should post screenshots of the WebAdmin console. I did follow both of the links I posted pretty closely. I can also upload the complete conf file. Are you willing to help troubleshoot this?
 
#5
Here are some screenshots of the webadmin and other setup I just did with a new server that has 1 gig of ram instead of only 256 megs. This is with OLS 1.64 and lswsgi 1.5 which appears to be the latest version. I noticed that in one of the tutorials the UDS address is given as lswcgi.sock instead of lswsgi.sock, but I tried that and it made no difference. I just modified the Example virtual host instead of creating a new one since I had some problems doing that as well in the previous installation. I haven't yet tried adding the external app settings in the virtual host context yet as well, but I did try that last time and it made no difference. I am wondering if my hello.wsgi file is just in the wrong place. I put it in a /python/ directory underneath the Example directory. There are lots of other variations on that I can try but I am just making guesses at this point and don't really know what I am doing. My next guess would be to either put hello.wsgi in either /Example/html or /Example/html/python.
 

Attachments

Top