correct setup for wsgi?

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

I have tried to follow these guides and alter various things and hope for success but so far I have not been able to get openlitespeed to run the simple wsgi script posted in the above link which is as follows:

def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/plain')])
return ['Hello World!\n']

I used webadmin to try to setup the external application and the script handlers correctly, but I just get a 503 error no matter what I do. Due to the nature of this error I guess I should point out that my server only has 256 MB of ram and about half of that is already being used, but so far litespeed has not used much memory. So this was not a big concern of mine. It's hard to believe that that tiny python script could use a lot of memory either. I do have python 2 and 3 installed and LSWSGI is in the fcgi-bin directory. If LSWSGI does use large amounts of memory like more than 100 MB or something then I guess I cannot run it on this server.

Anyway I am hoping that this might just be an incorrect setup error. I setup the external LSAPI app in both the general config and in the virtual hosting. I guess I should post what I have for each setting, but there are a lot of settings.

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

The wsgi file was named wsgi.py and I tried putting it in a .wsgi file too but I don't think the mime is set up for that and I don't know how to add mimes. In fact I should probably check the mime settings to make sure the .py extension maps to LSWSGI, but it just seems like lswsgi is not running at all. I uploaded an error.log, but I am already thinking about giving up either on python scripting for litespeed or on litespeed for python scripting. It doesn't seem to be working too well for me unless someone here can help me.
 

Attachments

Top