Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:cloudlinux:enable_ruby_python_selector [2019/11/28 15:41]
George Wang [Steps to Enable Python and Ruby Selector]
litespeed_wiki:cloudlinux:enable_ruby_python_selector [2021/08/24 11:58] (current)
Lisa Clarke Copyediting
Line 15: Line 15:
   - Run script to install required ruby/python lsapi modules: <​code>/​usr/​local/​lsws/​admin/​misc/​enable_ruby_python_selector.sh</​code>​   - Run script to install required ruby/python lsapi modules: <​code>/​usr/​local/​lsws/​admin/​misc/​enable_ruby_python_selector.sh</​code>​
   - Switch to LiteSpeed and try a ruby/python app   - Switch to LiteSpeed and try a ruby/python app
-===== Restart Python and Ruby Application ===== +===== Restart ​the Python and Ruby Application ===== 
-Python and Ruby application ​can be restarted ​by touching ​file <​code>​<​app_root_dir>/​tmp/​restart.txt</​code>​. +There are two ways to restart the Python and Ruby application: through the cPanel CloudLinux Python Application Manager, or by touching ​the ''​<​app_root_dir>/​tmp/​restart.txt''​ file.
-For example, if a python application is located at <​code>/​home/​user1/​mypythonapp</​code>,​ command <​code>​touch /​home/​user1/​mypythonapp/​tmp/​restart.txt</​code>​ will make server to restart the application.+
  
 +For example, if a Python application is located at ''/​home/​user1/​mypythonapp''​ the command would be: 
 +
 +<​code>​touch /​home/​user1/​mypythonapp/​tmp/​restart.txt</​code>​
 +
 +This will tell the server to restart the application.
 +
 +**NOTE**: If you are restarting the Python app by touching ''<​app_root_dir>/​tmp/​restart.txt'',​ and the file already exists, you must still ''​touch''​ it to restart the app. 
  
 ===== Troubleshooting ===== ===== Troubleshooting =====
 +====  The application does not work properly ====
 If your application does not work properly, you can try two simple steps to check if the application has been setup properly: If your application does not work properly, you can try two simple steps to check if the application has been setup properly:
   - If possible, switch back to Apache temporarily to verify if the application works properly under Apache.   - If possible, switch back to Apache temporarily to verify if the application works properly under Apache.
Line 46: Line 53:
  
 This indicates Django was not properly set up for the application. ​ This indicates Django was not properly set up for the application. ​
 +
 +==== The application will not restart ====
 +
 +If ''​touch <​app_root_dir>/​tmp/​restart.txt''​ or the CloudLinux Python manager fail to restart the Python application,​ there may be some old lswsgi processes in the way. Use the ''​ps''​ command to verify:
 +
 +<​code>​
 +ps -ef | grep pythontest
 +</​code>​
 +<​code>​
 +pythont+ 508045 1 0 Aug13 ? 00:01:23 /​opt/​alt/​python37/​bin/​lswsgi -m /​home/​pythontest/​pyapp1/​passenger_wsgi.py
 +pythont+ 890556 1 0 Jul31 ? 00:05:34 /​opt/​alt/​python37/​bin/​lswsgi -m /​home/​pythontest/​pyapp1/​passenger_wsgi.py
 +pythont+ 1470047 1 0 Jul19 ? 00:10:36 /​opt/​alt/​python37/​bin/​lswsgi -m /​home/​pythontest/​pyapp1/​passenger_wsgi.py
 +pythont+ 1900598 1866381 0 15:14 ? 00:00:00 /​opt/​alt/​python37/​bin/​lswsgi -m /​home/​pythontest/​pyapp1/​passenger_wsgi.py
 +root 1902042 1898738 0 15:22 pts/2 00:00:00 grep --color=auto pythontest
 +pythont+ 2741844 1 0 Jul23 ? 00:08:41 /​opt/​alt/​python37/​bin/​lswsgi -m /​home/​pythontest/​pyapp1/​passenger_wsgi.py
 +</​code>​
 +
 +Even though you may have restarted the latest lswsgi process, the old running processes can cause restart issues. You may find, even if you switch to Apache, that these processes remain. The best way to deal with them is to log into the user via SSH and manually kill the processes.
 +
  • Admin
  • Last modified: 2019/11/28 15:41
  • by George Wang