Sometimes, Access to cPanel and Webmail blocks firewall using standard ports (2082, 2083, 2085, 2096). To bypass this restriction, you can set up a subdomain and proxy script, allowing secure access through regular HTTP ports (80/443). Here’s how to do it.
Steps to Access cPanel and Webmail Behind a Firewall
- Important Note
Installation requires access to cPanel from a system not behind a firewall. Complete setup there before accessing from behind a firewall. - Log in to cPanel
Open:
www.yourdomain.com/cpanel
Or:
www.yourdomain.com:2085 - Create a Subdomain
Add a subdomain named cPanel inside your hosting account.
Example: cpanel.yourdomain.com - Upload the Proxy Script
Copy the file cpanelproxy.php into
/public_html/cpanel/ - Modify or Create .htaccess File
Inside /public_html/cpanel/, edit or create a .htaccess file and add:
– RewriteEngine on
– RewriteCond %{REQUEST_URI} !^/cpanelproxy.php
– RewriteRule .* /cpanelproxy.php [last] - Access cPanel / Webmail
Once the subdomain is active, you can log in via:
http://cpanel.yourdomain.com
Pro Tips
- Use HTTPS (https://cpanel.yourdomain.com) for secure access.
- Ensure mod_rewrite is enabled on your server for .htaccess rules to work.
- Test Webmail access as well:
http://cpanel.yourdomain.com/webmail