This is an old revision of the document!
How to Enable CloudLinux Python and Ruby Selector (alt-mod_passenger) for LSWS
To enable Python or Ruby on a shared hosting environment instead of a dedicated VPS environment, CloudLinux Python and Ruby Selector is recommended. If it is not for a shared hosting environment, you can refer to our archive section for LSWS native setup.
The Python and Ruby Selector allows end users to select the specific version of Python or Ruby they need.
Requirements
- LiteSpeed Web Server 5.2+
- CloudLinux
Steps to Enable Python and Ruby Selector
- Make sure Python and Ruby Selector works properly under Apache (follow CloudLinux instructions to install and configure).
- Test a Ruby or Python application with Apache and ensure it is running OK.
- Run script to install required ruby/python lsapi modules:
/usr/local/lsws/admin/misc/enable_ruby_python_selector.sh
- Switch to LiteSpeed and try a ruby/python app
Trouble shooting
If you application does not work properly, you can try two simple steps to check if application has been setup properly.
- If possible, switch back to Apache temporarily to verify if the application works properly or not.
- check if any error logged into <APP_ROOT_DIR>/stderr.log, fix the error and try again.
For example:
Python application writes error to stderr.log under the application root directory.
/home/user1/dingodossier/mbntp/stderr.log has
Traceback (most recent call last):
File "/home/user1/dingodossier/mbntp/passenger_wsgi.py", line 8, in <module> wsgi = imp.load_source('wsgi', 'mbntp/wsgi.py') File "/home/user1/virtualenv/dingodossier_mbntp/3.4/lib64/python3.4/imp.py", line 171, in load_source module = methods.load() File "<frozen importlib._bootstrap>", line 1220, in load File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked File "<frozen importlib._bootstrap>", line 1129, in _exec File "<frozen importlib._bootstrap>", line 1471, in exec_module File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed File "mbntp/wsgi.py", line 10, in <module> from django.core.wsgi import get_wsgi_application
ImportError: No module named 'django'
It indicates Django was not properly set up for this application. You should try it under Apache to make sure it is working.