Author Topic: How to access CWP using a subdomain?  (Read 6787 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
How to access CWP using a subdomain?
« on: March 23, 2019, 08:01:31 PM »
Hi,

I have CWP installed on my VPS. I feel it irritating to access the CWP like www.example.com:2087. Is there any way that I can get it working like www.example.com?.
I am really sorry if my question sounds stupid, but i really want to know if it's possible because i was able to do it in other control panels.


Thanks

Offline
***
Re: How to access CWP using a subdomain?
« Reply #1 on: March 23, 2019, 09:51:24 PM »
Your domain "example.com" is used only for the CWP panel..??

I would not recommend this unless you're already watching *carefully* your http and firewall accesses logs in your server.
This is due to virtual harassment, and although you can not prevent someone from discovering that you use CWP, is not good you make it easier.
The robot scanners would very easily find your main login page and try to hack it.
But I am not adept of "security by obscurity".

And what you want is easy to do, if your domain is used only for the CWP panel, just add a line to your '/etc/csf/csf.redirect' file, which has the following syntax:

=============================
IPx|portA|*|portB|tcp/udp    - To IPx to portA redirects to portB
*|portA|*|portB|tcp/udp      - To portA redirects to portB
=============================

But this would break access to roundcube, if you use it.
And will break any site acessing the same IP address.
You would need more than one IP address to use another services/sites.

So, you would need to append the following line to that file:
Code: [Select]
*|80|*|2087|tcp

And then need to restart the firewall:
Code: [Select]
# csf -x; csf -e

Regards,
Netino
« Last Edit: March 23, 2019, 10:17:07 PM by Netino »