pythondjangoopenlitespeed

OpenLiteSpeed django app broken after ubuntu upgrade


I was running an Ubuntu Image of litespeed django application,

https://azuremarketplace.microsoft.com/en-us/marketplace/apps/litespeedtechnologies.openlitespeed-django

It was 20.04 LTS, I tried to do a release upgrade which was successful to 22.04 but the OpenLiteSpeed server now fails to run.

The request keeps on spinning in the browser and after some time errors with 503. There is no entry in the /usr/local/lsws/logs/stderr.log file regarding the 503 error

Steps I already tried:

  1. Reinstalled python virtual environment
  2. Re-installed the dependencies
  3. Tried running the application on 8000 port using python3 manage.py runserver command and it works on the browser as expected
  4. updated the vhost file on the Server with the update python runtime path from 3.8 to 3.10

Solution

  • Recompile the wsgi-lsapi

    Once you upgraded to Ubuntu 22.04, please recompile the wsgi-lsapi binary with the new system.

    Get the Python LSAPI version here. Replace the VERSION below with the version number you find there (like 2.1).

    curl -O http://www.litespeedtech.com/packages/lsapi/wsgi-lsapi-VERSION.tgz
    tar xf wsgi-lsapi-2.1.tgz
    cd wsgi-lsapi-2.1
    python3 ./configure.py
    make
    mv lswsgi /usr/local/lsws/fcgi-bin/
    

    Then restart the Web Server

    systemctl restart lsws