Contact Us

2.3 Accessing CyberPanel only through https://

You are here:
< All Topics

After a SSL has been issued for the hostname, all traffic can be redirected through the default SSL port 443 and then closing the standard accessing port 8090. That involves a little bit of tinkering with the configuration files. However all changes can be reverted, if anything goes wrong. Log in to SSH and edit the following file httpd_config.conf:

[user@hostname]$ vim /usr/local/lsws/conf/httpd_config.conf

Insert the following block before #It not set, will use host name as serverName, replacing the address value with your hostname:

extprocessor cyberpanel {
  type                    proxy
  address                 https://hostname.example.com:8090
  maxConns                100
  pcKeepAliveTimeout      60
  initTimeout             60
  retryTimeout            0
  respBuffer              0
}

Restart LiteSpeed with:

[user@hostname]$ systemctl reload lshttpd.service

The go to the website’s .htaccess located in /public_html/.htaccess. If it is not there, create it and add the following line, which will redirect all requests through https:// only:

REWRITERULE ^(.*)$ HTTP://cyberpanel/$1 [P]
 

Once all that is done, you can close port 8090 from the firewall, either by closing from the terminal or by deleting it from CyberPanel’s menu:

This will close port 8090 and the panel will no longer be accessible through it. The new URL will be https://hostname.example.com. This will further secure the location of the panel.