Prerequisite:
*Root Domain is properly configured in QuicCloud DNS Zone
- Login to CyberPanel
- Create Website (This website will be the hostname website)
- SSL > Hostname SSL > Choose Website Name just created from the dropdown > Issue SSL
- Open SSH > Access as root:
sudo su - > nano /usr/local/lsws/conf/httpd_config.xml > Find the > Insert below contents inside > ctrl + x > y > enter
***Change the address with the hostname you just created with the port
***If Port has been changed such as to 2083, enter the changed port
***example: panel.my-domain.com:2083
- SSH > Insert below: > ***IF It returns error, you have not inserted the content correct. Any space can cause the error.
/usr/local/lsws/bin/lswsctrl restart
- Go to CyberPanel > Go to the Hostname Website > Filemanager > create .htaccess if necessary under ‘public_html’ > Open File > Save Below (CHANGE THE ADDRESS TO Yours including port):
BEGIN CUSTOM PANEL WITHOUT PORT
RewriteEngine On
RewriteRule ^(.*)$ HTTPS://panel.my-domain.com:2083/$1 [P]
END CUSTOM PANEL WITHOUT PORT
-----NOTE-----
*You can Stop here if you don’t use QuicCloud (You can also use with Cloudflare or with other Reverse Proxy)
*QuicCloud does not allow any port except 80, 443. This process is necessary.
*Cloudflare has a list of port allowed so Cloudflare. This process is optional. Note. 8090 is not allowed by Cloudflare
-----NOTE-----
- Go to QuicCloud > DNS Zone > Add New Record > Choose Type A > Enter Host as shown below (This is an example. You must match your host to your website just created. Example: panel.my-domain.com; just enter ‘panel’
Panel
Enter your server Ip to IPv4 address > Add Record
8. Go to Settings > Domain Alias: > add your alias (this example: panel.my-domain.com)
- Go to MyDomain > Click your domain > Click CDN > CDN Config > Turn ON Bypass CDN > then Turn OFF Bypass CDN (sometimes QC DNS cannot detect new record without bypassing CDN) > go to DNS Status > Reverify DNS or just wait about 5-10 min > if you see verification status is OK, DONE
[OPTIONAL] Protect the Panel access to your IP address only:
- Go to Cyberpanel > Open Rewrite Rule or htaccess file just created before > Insert below (Change the IP address to yours. Below is for IP Range):
BEGIN PROTECT PANEL
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.[0-255]
RewriteRule ^.*$ - [F,L]
END PROTECT PANEL
Done.