Troubleshooting OpenLiteSpeed with Django and Daphne: Overcoming 503 Errors
Problem
I recently moved to OpenLiteSpeed Django and have my repository ready to be cloned. I have implemented Daphne to work smoothly with ASGI. However, I am encountering a 503 Service Unavailable error. I am unsure if OpenLiteSpeed can be used without PHP, as it seems to be waiting for PHP to run or is built to work within a PHP environment.
What I Have Tried
- Setup:
- Cloned my repository and set up everything needed for OpenLiteSpeed.
- Created a Daphne service file and configured it to create a socket file for OpenLiteSpeed to communicate with.
- Ensured all permissions are set correctly, and verified that the OpenLiteSpeed user "nobody" can access the socket file.
- Logs:
- Checked all logs (access, error, debug) but found no useful information.
- The only consistent issue is the 503 Service Unavailable error.
- Configuration:
- Removed the Example app block code from the
hosts_config.conf
file. - Tested the syntax with the
-t
command, and no errors were found.
Question
Can I use OpenLiteSpeed without PHP for my Django app? If not, what could be the best alternative to OpenLiteSpeed that works with ASGI apps and Daphne.
1 Reply
I was looking into this and from what I can tell, OpenLiteSpeed (at least in their own documentation) needs PHP in order to run properly:
https://docs.openlitespeed.org/config/
Did you happen to look at the following page on troubleshooting this error on OpenLiteSpeed's docs page?
https://docs.litespeedtech.com/lsws/cp/cpanel/503-error/
As far as alternatives go, there are a number of them:
https://alternativeto.net/software/openlitespeed/
I use NGINX a lot, and from what I have seen, NGINX is ASGI compliant. Just doing some googling I have seen a few posts on people talking about this sort of stuff:
https://www.reddit.com/r/django/comments/182wjom/deploy_django_asgi_with_ubuntu_server_nginx/
I hope that helps!
-Micah