Dev {Tricks}

  • Home
  • WordPress
  • OJS
  • Oxwall
  • Server and Hosting
You are here: Home / Server and Hosting / Web Control Panel / CentOS Web Panel / How to secure CWP (CentOS Web Panel)

June 20, 2026 by dev

How to secure CWP (CentOS Web Panel)

CWP (CentOS Web Panel) is powerful but not secure by default. If you leave it as-is, it will get attacked.

Here’s a practical hardening guide:


πŸ”’ 1. Change Default Ports (VERY IMPORTANT)

CWP runs on:

  • 2030 (HTTP)
  • 2031 (HTTPS)

πŸ‘‰ Bots scan these ports constantly.

Change it:

Edit config:

vi /usr/local/cwpsrv/conf/cwpsrv.conf

Change:

listen 2031 ssl;

➑️ Example:

listen 2087 ssl;

Then restart:

service cwpsrv restart

πŸ” 2. Enable Firewall (CSF) Properly

CWP comes with CSF (ConfigServer Firewall)

Go to:
πŸ‘‰ CWP β†’ Security β†’ CSF Firewall

Recommended:

  • Enable TESTING = 0
  • Enable:
    • SYN Flood Protection
    • Port Scan Tracking
    • Connection Tracking

Allow only needed ports:

22 (SSH)
80 (HTTP)
443 (HTTPS)
YOUR NEW CWP PORT

🚫 3. Disable Root Login (SSH)

Edit:

vi /etc/ssh/sshd_config

Change:

PermitRootLogin no

Restart:

systemctl restart sshd

πŸ‘‰ Create a sudo user instead.


πŸ”‘ 4. Use SSH Key (No Password Login)

vi /etc/ssh/sshd_config

Set:

PasswordAuthentication no

πŸ‘‰ This alone blocks 90% of brute-force attacks.


🧱 5. Enable ModSecurity + OWASP Rules

Go to:
πŸ‘‰ CWP β†’ Security β†’ ModSecurity

Enable:

  • ModSecurity = ON
  • OWASP rules = ON

πŸ‘‰ Protects against:

  • SQL injection
  • XSS
  • common exploits

🌍 6. Restrict CWP Access by IP (BEST MOVE)

If only you use the panel:

Allow only your IP:

In CSF:

csf -a YOUR_IP

Then block panel port for others.

πŸ‘‰ This is one of the strongest protections.


πŸ”„ 7. Keep System Updated

yum update -y

And update CWP:

sh /scripts/update_cwp

πŸ›‘οΈ 8. Install Fail2Ban (Extra Layer)

yum install fail2ban -y
systemctl enable fail2ban
systemctl start fail2ban

πŸ‘‰ Protects:

  • SSH
  • login brute force

πŸ” 9. Secure PHP & Disable Dangerous Functions

Edit php.ini:

vi /usr/local/php/php.ini

Disable:

exec,passthru,shell_exec,system,proc_open,popen

πŸ“‚ 10. Fix File Permissions

chmod 755 /home/*
chmod 644 public_html files

πŸ”’ 11. SSL for Panel

Make sure you use:

https://your-ip:PORT

πŸ‘‰ You can install Let’s Encrypt inside CWP panel.


🚨 12. Change Default Login URL (Optional but smart)

Use firewall rules to restrict /login access or proxy it.


πŸ’‘ Bonus (Highly Recommended)

  • Disable unused services:
systemctl disable ftp
  • Remove unused PHP versions
  • Monitor logs:
/var/log/secure

βœ… Minimum Must-Do Checklist

If you do nothing else, do these 5:
βœ” Change port
βœ” Enable CSF firewall
βœ” Disable root SSH
βœ” Use SSH key
βœ” Restrict IP access

 

 

Post Views: 3

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook

Filed Under: CentOS Web Panel

You May Also Like

How to delete “Ghost Account” from CWP or CWPpro
WordPress site with WooCommerce is down with Mod Security
How to Install Maldet and Run a Scan | Maldetect
Where is Roundcube location on CWP control panel?
Cannot Edit fstab as it is a Read-Only File
How to Add Swap Space/file on CentOS 7 and CentOS 8
Disk Usage Check | CWP | CWPpro
How to clean all log files in CWP or CWP Pro | Control Web Panel
MySQL: Error Code: 1118
How To Create a New User and Grant Permissions in MySQL
Move files in the Linux terminal
How to Clean the YUM Cache in CentOS

Hire Me!

  • Upwork
  • Freelancer
  • Fiverr
  • Guru

  • Upwork
  • Freelancer
  • Fiverr
  • Guru

www.ojsexpert.com
www.ojsdev247.com

Recent Posts

  • How to secure CWP (CentOS Web Panel)
  • How to delete “Ghost Account” from CWP or CWPpro
  • SMTP and eSMTP error code list
  • CWP – Nginx Reverse Proxy Server Failed
  • OJS Create a Custom Page + Custom Template
  • Self-hosted GrassBlade LRS – A complete installation guideline
  • ΰ¦˜ΰ¦°ΰ§‡ বসে ঑লার ΰ¦†ΰ§Ÿ করুন এই ৩০ টি ΰ¦“ΰ§Ÿΰ§‡ΰ¦¬ΰ¦Έΰ¦Ύΰ¦‡ΰ¦Ÿ ব্যবহার করে
  • What is JavaScript? | Learn JavaScript from Scratch | Introduction, History, Uses & Prerequisites | Day01
  • WordPress site with WooCommerce is down with Mod Security
  • To get your email for castamodel.com going to the right place, you need to update your DNS settings.
  • Security and WordPress
  • ROR
  • How do we copy google form to google workspace?
  • Install ImageMagick – Almalinux
  • How to remove /public/ from URL in Laravel
  • How to install Maldet alert?
  • How to Install Maldet and Run a Scan | Maldetect
  • Where is Roundcube location on CWP control panel?
  • How To Add Node.js Projects In aaPanel?
  • SPF/DKIM/DMARC Tools

Categories

  • Affiliate Marketing (2)
  • Customization (4)
    • CSS (2)
  • Email Solutions (24)
    • FrontApp (2)
    • Google Spreadsheet (2)
    • Microsoft Outlook (1)
    • PHP Email Form (3)
    • PolyMail (2)
    • Recaptcha (1)
    • Roundcube (4)
    • Thunderbird (3)
    • WebMail (5)
  • Games (1)
  • How to (89)
  • Joomla (6)
    • Akeeba (1)
    • Fix & Tricks (3)
  • jQuery (4)
  • jQuery Plugins (4)
    • BX Slider (1)
    • Slick (1)
  • Laravel (5)
  • Marketplace (6)
  • Miscellaneous (32)
  • MultiSaaS (1)
  • OJS (56)
    • Crossref (1)
    • Help (37)
    • Installation (10)
      • Issues (5)
    • Plugins (8)
    • Scholar Indexing (2)
    • Theme (7)
      • Templates (7)
        • Frontend (6)
        • legacy (1)
    • Theme Customization (10)
    • Theme Development (14)
    • TPL CSS JS (2)
    • Upgrade (11)
  • OSTAD (17)
  • Oxwall (3)
  • Payment Methods (1)
    • Paypal (1)
  • PC Tips and Tricks (14)
    • MS Office (2)
      • PowerPoint (1)
    • Windows (4)
  • PHP Parse error (2)
  • phpBB (2)
  • Server and Hosting (216)
    • Billing and Management (10)
      • Blesta (5)
      • Boxbilling (2)
      • WHMCS (5)
    • Email (10)
      • Postfix (3)
    • Error and Fix (17)
    • FTP (2)
    • Linux Distribusion (29)
      • Almalinux (14)
      • CentOS (18)
      • Debian (22)
      • Ubuntu (20)
    • Mail Server Solusion (7)
      • iRedMain (6)
    • MySQL (12)
    • Providers (70)
      • AWS (38)
      • Bluehost (38)
      • Cloudcone (27)
      • Contabo (41)
      • Digitalocean (69)
      • Hetzner (4)
      • HostGator (37)
      • Hostinger (9)
      • RackNerd (11)
      • VPSDime (39)
    • Security (21)
      • SSH (8)
    • VPS Management (72)
    • Web Control Panel (150)
      • aaPanel (14)
      • CentOS Web Panel (49)
      • cPanel (33)
      • CyberPanel (7)
      • DirectAdmin (96)
        • Find & fix (38)
      • ISPConfig (17)
      • KeyHelp (7)
      • Plesk (27)
      • Webmin (25)
        • Usermin (2)
        • Virtualmin (13)
      • WHM (18)
  • Tutorials (1)
    • JavaScript – ProjuktiPlus (1)
  • Uncategorized (22)
  • Wordpress (90)
    • Elementor (2)
    • Find and Fix (11)
    • Functions (5)
    • Genesis (9)
    • Glossary (1)
    • How to (22)
    • Neuron TD (15)
      • Console Error (1)
      • functions (5)
        • register_post_type (1)
        • register_sidebar (1)
        • theme_files (1)
        • theme_supports (1)
      • Image Directory (1)
      • Menu (2)
      • Query (4)
    • Plugins (14)
      • Contact Form 7 (5)
      • Duplicator (1)
      • Essential Grid (2)
    • Softaculous (3)
    • Speed and Security (4)
    • Stock Theme Development (6)
      • Header Footer (1)
      • PHP (1)
      • VC (1)
    • Theme Development (2)
      • Issues (1)
      • Menu (1)
    • Timer Theme Development (3)
    • Update (2)
    • Woocommerce (3)
    • WP Basic Guideline (8)

Important DEV links

  • Premium Themes
    • Themeforest
    • Envato Market
  • Built With (What Theme is That?)
    • What WP theme is that
    • Joomla Template Detector
    • Drupal Template Detector
    • Prestashop Template Detector
    • Shopify Theme Detector
    • Squarespace Template Detector
    • OpenCart Detector
    • WordPress.com Theme Detector
  • Domain/IP history checker
    • Who IS request
    • Hosting Info
  • Check DNS Propagation
    • DNS Checker
    • intoDNS
  • What is my IP
    • What is My IP Address
    • What is My IP
    • IP location
    • What is My IP
    • Porkbun
  • SEO Tools
    • Visitor Traffic
    • Broken Link
    • Website Speed Test
      • SEMrush
      • GTmetrix
      • Pingdom
      • PageSpeed Insights
      • DebugBear
      • keyCDN
  • Photo Image
    • Remove Background 50 Free Preview Image 375 Γ— 666 per month
  • Domain Registrars
    • 123-Reg
    • Porkbun
    • Freenom
    • Namecheap NEWCOM598
  • Hosting Providers
    • Bluehost
    • Hostgator
    • Inmotion
  • Hosting Control Panel
    • CWPpro (FREE)
    • DirectAdmin (Trial 60 Days, One account $2/month)
    • ISPConfig (Free)
  • Webmaster Tools
    • Google
    • Bing
    • Yandex
  • Miscellaneous
    • Time Calculator

 

Categories

  • Affiliate Marketing (2)
  • Customization (4)
    • CSS (2)
  • Email Solutions (24)
    • FrontApp (2)
    • Google Spreadsheet (2)
    • Microsoft Outlook (1)
    • PHP Email Form (3)
    • PolyMail (2)
    • Recaptcha (1)
    • Roundcube (4)
    • Thunderbird (3)
    • WebMail (5)
  • Games (1)
  • How to (89)
  • Joomla (6)
    • Akeeba (1)
    • Fix & Tricks (3)
  • jQuery (4)
  • jQuery Plugins (4)
    • BX Slider (1)
    • Slick (1)
  • Laravel (5)
  • Marketplace (6)
  • Miscellaneous (32)
  • MultiSaaS (1)
  • OJS (56)
    • Crossref (1)
    • Help (37)
    • Installation (10)
      • Issues (5)
    • Plugins (8)
    • Scholar Indexing (2)
    • Theme (7)
      • Templates (7)
        • Frontend (6)
        • legacy (1)
    • Theme Customization (10)
    • Theme Development (14)
    • TPL CSS JS (2)
    • Upgrade (11)
  • OSTAD (17)
  • Oxwall (3)
  • Payment Methods (1)
    • Paypal (1)
  • PC Tips and Tricks (14)
    • MS Office (2)
      • PowerPoint (1)
    • Windows (4)
  • PHP Parse error (2)
  • phpBB (2)
  • Server and Hosting (216)
    • Billing and Management (10)
      • Blesta (5)
      • Boxbilling (2)
      • WHMCS (5)
    • Email (10)
      • Postfix (3)
    • Error and Fix (17)
    • FTP (2)
    • Linux Distribusion (29)
      • Almalinux (14)
      • CentOS (18)
      • Debian (22)
      • Ubuntu (20)
    • Mail Server Solusion (7)
      • iRedMain (6)
    • MySQL (12)
    • Providers (70)
      • AWS (38)
      • Bluehost (38)
      • Cloudcone (27)
      • Contabo (41)
      • Digitalocean (69)
      • Hetzner (4)
      • HostGator (37)
      • Hostinger (9)
      • RackNerd (11)
      • VPSDime (39)
    • Security (21)
      • SSH (8)
    • VPS Management (72)
    • Web Control Panel (150)
      • aaPanel (14)
      • CentOS Web Panel (49)
      • cPanel (33)
      • CyberPanel (7)
      • DirectAdmin (96)
        • Find & fix (38)
      • ISPConfig (17)
      • KeyHelp (7)
      • Plesk (27)
      • Webmin (25)
        • Usermin (2)
        • Virtualmin (13)
      • WHM (18)
  • Tutorials (1)
    • JavaScript – ProjuktiPlus (1)
  • Uncategorized (22)
  • Wordpress (90)
    • Elementor (2)
    • Find and Fix (11)
    • Functions (5)
    • Genesis (9)
    • Glossary (1)
    • How to (22)
    • Neuron TD (15)
      • Console Error (1)
      • functions (5)
        • register_post_type (1)
        • register_sidebar (1)
        • theme_files (1)
        • theme_supports (1)
      • Image Directory (1)
      • Menu (2)
      • Query (4)
    • Plugins (14)
      • Contact Form 7 (5)
      • Duplicator (1)
      • Essential Grid (2)
    • Softaculous (3)
    • Speed and Security (4)
    • Stock Theme Development (6)
      • Header Footer (1)
      • PHP (1)
      • VC (1)
    • Theme Development (2)
      • Issues (1)
      • Menu (1)
    • Timer Theme Development (3)
    • Update (2)
    • Woocommerce (3)
    • WP Basic Guideline (8)
  • Home
  • WordPress
  • OJS
  • Oxwall
  • Server and Hosting

Copyright © 2026 Β· Executive Pro Theme on Genesis Framework Β· WordPress Β· Log in