Hi everyone.
I have 2 Flask applications hosted on different servers and I would like to concentrate them on the same VPS running OpenLiteSpeed. I tried to follow the only tutorial I could find (https://openlitespeed.org/kb/python-wsgi-applications/) to set it up. I created a virtual host and its root is located inside my /home directory. It is structured like this:
/home
|-- /$VH_NAME
|------ wsgi.py
|------ /virtualenv
|------ /app
|------------ __ini__.py
On WebAdmin, I have created for this virtual host the following context:
URI /
Location /home/$VH_NAME/
Binary Path /usr/local/lsws/fcgi-bin/lswsgi
Application Type WSGI
Startup File wsgi.py
Environment:
PYTHONPATH=/home/$VH_NAME/virtualenv/lib/python3.6:/home/$VH_NAME
LS_PYTHONBIN=/home/$VH_NAME/virtualenv/bin/python
It worked just fine. So I created another virtual host and did exactly the same thing. I configured it the same way I did with the first one. Now none of them work. Both return error 500. The browser says they fail because of multiple redirections (I don't understand why).
The stderr.log files of both applications show this error on wsgi.py:
They also show multiple consecutive lines like this:
None of these errors occurred when there was only one virtual host.
Is there anyone who can help me? Thanks a lot!
I have 2 Flask applications hosted on different servers and I would like to concentrate them on the same VPS running OpenLiteSpeed. I tried to follow the only tutorial I could find (https://openlitespeed.org/kb/python-wsgi-applications/) to set it up. I created a virtual host and its root is located inside my /home directory. It is structured like this:
/home
|-- /$VH_NAME
|------ wsgi.py
|------ /virtualenv
|------ /app
|------------ __ini__.py
On WebAdmin, I have created for this virtual host the following context:
URI /
Location /home/$VH_NAME/
Binary Path /usr/local/lsws/fcgi-bin/lswsgi
Application Type WSGI
Startup File wsgi.py
Environment:
PYTHONPATH=/home/$VH_NAME/virtualenv/lib/python3.6:/home/$VH_NAME
LS_PYTHONBIN=/home/$VH_NAME/virtualenv/bin/python
It worked just fine. So I created another virtual host and did exactly the same thing. I configured it the same way I did with the first one. Now none of them work. Both return error 500. The browser says they fail because of multiple redirections (I don't understand why).
The stderr.log files of both applications show this error on wsgi.py:
from app import app as application
ModuleNotFoundError: No module named 'app'
ModuleNotFoundError: No module named 'app'
2022-02-23 21:05:15.949401 [101426] packetLen < 0
Is there anyone who can help me? Thanks a lot!