How to remove port 8090 from CyberPanel

Many of the users have asked about removing port 8090 so that they can visit CyberPanel on a plain domain like panel.cyberpanel.net. However, normally this is not possible because port 8090 is hardcoded into to LSCPD server which powers CyberPanel. (Hardcoded configurations are used to improve performance)

Step 1: Create a Website for Hostname

First, you need to decide the domain on which you want to access CyberPanel without the port being appended to it. We are going to use https://switch.cyberpanel.net.

Now create a website for this domain (hostname). Please make sure that A record of this domain already points towards your server.

Step 2: Issue Hostname SSL

We now need to issue Hostname SSL for the domain we choose above. In our example it is https://switch.cyberpanel.net.

Setup CyberPanel without port 8090 (OpenLiteSpeed)

Steps above are common whether you run OpenLiteSpeed or LiteSpeed Enterprise Web server. But now you need to do thing differently. We will discuss OpenLiteSpeed first.

Open command line and edit: /usr/local/lsws/conf/httpd_config.conf

Paste following content:

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

Please replace https://switch.cyberpanel.net:8090 with the domain you choose in Step 1.

Use Rewrite Rules to Proxy to port 8090

You can now use rewrite rules to proxy traffic to port 8090, now edit rewrite rules for the domain you choose in Step 1 using the rewrite rule guide. You can use these rules:

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

Once done, you can now visit CyberPanel on your domain without port 8090. You can also visit PHPMyAdmin and Rainloop.

Setup CyberPanel without port 8090 (LiteSpeed Enterprise Web server)

If you have installed CyberPanel Ent, you are using LiteSpeed Enterprise Web server. If you are not already on CyberPanel Ent and want to switch you can read the switch guide.

Open command line and edit: /usr/local/lsws/conf/httpd_config.xml

Paste following content:

<extProcessor>
      <type>proxy</type>
      <name>cyberpanel</name>
      <address>switch.cyberpanel.net:8090</address>
      <maxConns>100</maxConns>
      <pcKeepAliveTimeout>60</pcKeepAliveTimeout>
      <initTimeout>60</initTimeout>
      <retryTimeout>0</retryTimeout>
      <respBuffer>0</respBuffer>
</extProcessor>

Make sure to paste it inside in the configuration file.

Use Rewrite Rules to Proxy to port 8090

You can now use rewrite rules to proxy traffic to port 8090, now edit rewrite rules for the domain you choose in Step 1 using the rewrite rule guide. You can use these rules:

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

Once done, you can now visit CyberPanel on your domain without port 8090. You can also visit PHPMyAdmin and Rainloop.

4 Likes

Good afternoon, thanks for the great post. After carrying out the steps to change the url and remove the port from the web address I was able to access the Cyber Panel control panel, phpmyadmin and webmail client. However, after inserting the processor in the configuration as described, I cannot access the websites through the cyberpanel interface. gives the error that the website does not exist. I can’t access filemaneger either and the error is a blank page with an error message.

2 Likes

The process worked but now I have the same issue. Ever fix the issue? If your put your port number back into the URL it works that way but not how we intend.

Everything worked for me (maybe because now it’s a later CP version). Though in order to force SSL I adjusted the rule to the following:

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
REWRITERULE ^(.*)$ http://cyberpanel/$1 [P]
2 Likes
1 Like

After adding the Rewrite-rule. now am getting Error 503.

Proxy target is not defined on external application list, please add a 'web server' with name 'cyberpanel'

Look like extprocessor directive not working for some reason.

hai, i have same problem is there any way to solve the problem?

hi, i have same problem is there any way to solve the problem?

Thank you bro! You save me days of work. (Y)

Hey @CristhianJP , can you explain the steps to fix this? Still getting 503

Thanks!

It works removing port 8090 but i have problems when trying to manage pages without port, it shows 403 ## Forbidden… Access to this resource on the server is denied!

Also, when trying to rewrite rules for snappymail webmail it shows An error occurred.
Please refresh the page and try again. Error: Failed loading /snappymail/snappymail/v/2.15.3/static/js/min/libs.min.js

If anyone knows how can we configure it. Let us know, please!

Thanks.

@usmannasir
Hello Brother, two days ago I installed CyberPanel for the first time.
Then I opened the port from Firewall and changed the CyberPanel port from the “Server Status” menu. Till this moment CyberPanel was working as expected. Then I followed your instruction to use a hostname for the instance. After modifying the httpd_config.conf file correctly and adding the rewrite rules in the correct format the whole system went down.

The question is can we change the port to any port(except well-known) and follow your instruction to remove the port number from the panel URL?

System Details:
Control Panel: CyberPanel v2.3.3
OS: Ubuntu 20.04 LTS
VPS Type: OpenVZ VPS

Thank you!

  • R. Ahmed

Update: I successfully changed the port and was able to remove the port from the URL. But it is not recommended.

Any solution to “websites” page returning 404 not found after removing port 8090?

when you trying to change your admin without port 8090 be sure your 443 and 8090 is accessible from outside world

503 error means your browser could not access this resource
I assumed you are install cyberpanel in your office machine which is intranet environment.
you could diagnose this issue if it’s intranet network. change your windows machine host files
C:\Windows\System32\drivers\etc\hosts
192.168.1.100 admin.mydomain.com

but what I did is below
I had changed my external app address from “panel.mydomaind.com:8090” to “127.0.0.1:8090”
extprocessor cyberpanel {

  type                    proxy
  address                 https://127.0.0.1:8090
  maxConns                100
  pcKeepAliveTimeout      60
  initTimeout             60
  retryTimeout            0
  respBuffer              0
}

excellent! I was looking for a solution https! thank you

Getting Internal server error 500 after this

1 Like