Category: OpenLiteSpeed

  • systemd service file for openlitespeed

    systemd service file for openlitespeed

    To start/stop OpenLiteSpeed web server, you can use the following systemd service file

    vi /usr/lib/systemd/system/lshttpd.service
    

    Add following content

    [Unit]
    Description=OpenLiteSpeed HTTP Server
    After=network-online.target remote-fs.target nss-lookup.target
    Wants=network-online.target
    
    [Service]
    Type=forking
    PIDFile=/var/run/openlitespeed.pid
    ExecStart=/usr/local/lsws/bin/lswsctrl start
    ExecReload=/usr/local/lsws/bin/lswsctrl restart 
    ExecStop=/usr/local/lsws/bin/lswsctrl delay-stop
    
    KillMode=none
    PrivateTmp=false
    Restart=on-failure
    RestartSec=5
    
    # do not want to be limited in anyway
    CPUAccounting=false
    TasksAccounting=false
    MemoryAccounting=false
    
    [Install]
    WantedBy=multi-user.target
    Alias=lsws.service
    Alias=openlitespeed.service
    

    To start openlitespeed on boot,

    systemctl enable lsws
    

    To start OpenLiteSpeed

    systemctl start lsws
    

    To stop OpenLiteSpeed

    systemctl stop lsws
    

    See OpenLiteSpeed

  • Change SSH port in CyberPanel

    Change SSH port in CyberPanel

    CyberPanel is a free open source control panel for web hosting. It use OpenLiteSpeed web server. You have the option to use Commercial LiteSpeed web server with CyberPanel.

    To change SSH port on CyberPanel server, login to CyberPanel, then go to

    Securiy > Secure SSH
    

    From the left side menu. On next page, you will get option to change SSH port.

    CyberPanel Change SSH port

    Once port is changed, click on “Save Changes” button. Now your SSH port changed to non standard port.

    Fix Web Terminal

    On side bar, you have “Web Terminal” that allow you to access sevrers terminal. If you change SSH port, this feature stop working. To get Web Terminal work again, you need to edit file

    vi /usr/local/CyberCP/WebTerminal/CPWebSocket.py
    

    Find

    DEFAULT_PORT = 22
    

    Replace with

    DEFAULT_PORT = 3333
    

    3333 – replace with your actual SSH port.

    Now you need to restart the cyberpanel, for this find the CyberPanel process with command

    ps aux | grep CPWebSocket
    

    Kill the process with

    kill -9 PID
    

    Example

    [root@musiverse ~]# ps aux | grep CPWebSocket
    root     188833  3.2  3.4 412708 35684 ?        Sl   17:19   0:41 /usr/local/CyberCP/bin/python /usr/local/CyberCP/WebTerminal/CPWebSocket.py
    root     189672  0.0  0.2 112808  2364 pts/2    S+   17:40   0:00 grep --color=auto CPWebSocket
    [root@musiverse ~]# kill -9 188833
    [root@musiverse ~]# 
    

    It will auto restart once you killed and Web Termianl on CyberPanel will work with custom SSH port.

    See CyberPanel