How to Setup Mod Security on CentOs Web Panel

Cheap reseller Hosting


Setup Mod Security

ModSecurity is an open source, cross-platform web application firewall (WAF) module. Known as the “Swiss Army Knife” of WAFs, it enables web application defenders to gain visibility into HTTP(S) traffic and provides a power rules language and API to implement advanced protections.

list of the most important usage scenarios :

  • Real-time application security monitoring and access control
  • Virtual patching
  • Full HTTP traffic logging
  • Continuous passive security assessment
  • Web application hardening
  • Something small, yet very important to you

Find more details of Mod Security

Step 1 – Go to Security then Click on Mod Security menu:


Step 2 – By default this module is not installed. Click on Install Mod Security Tab .


Once you click on it you can see the below message :


Once its install you can see the message :


That’s it. Mod_security includes some necessary rules  by default. But however if you want to go advance, you can manually edit each configuration file and adjust the rules as per your requirement.

Cheap web Hosting

How to Enable Config Server Firewall (CSF) on Centos Web Panel

Cheap reseller Hosting


Step 1 – Go to Security then Click on CSF Firewall










Click on CSF Firewall and Scroll down . Then you can see an Option to Enable firewall :






Click on Firewall Enable .

Step 3 – Once activated, you can now edit few lines of CSF Configuration. Click on the Firewall Configuration button. And Add the SSH Port which we have changed in my  Previous Post  how to change SSH Port . You can see the New Port number added in CSF configuration file :



Once done, click the Save Changes button.

Cheap web Hosting

How to change default SSH port on CentOS Web Panel (CWP)

Cheap reseller Hosting




Step 1 – Login to CWP Admin page as root via:











Step 2 – Now go to Services Config then click on SSH Configuration:






Once you click on SSH Configuration scroll down and you can see an option to Create File Backup





Click on the Button to take the backup . Once the Backup is completed you can see the below message :




Step 3 – Find the Following Line :

#port 22

Remove the # symbol and change the “22” (it is default port) to to any number between 1025 and 65536, For example is port 9999.








Now click on Save Changes and you can see the message :





Done .




Cheap web Hosting

How to Activate Varnish Cache Server on Centos Web Panel.

Cheap reseller Hosting


Activate Varnish Cache Server on Centos Web Panel.

  1. First, install CWP on your server.
  2. Do some basic configuration tasks.
  3. Login to CWP admin page as root or as user with root privilege via:


Step 1 – Go to Apache Settings then Varnish Cache Server.










Step 2 – You’ll then see a message saying that ***Varnish not installed. Now click on the blue Install Varnish button.







Once you Click on Install Varnish you can see all the Install Process :

Preparing...                ##################################################
varnish-release             ##################################################
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base:
 * extras:
 * rpmforge:
 * updates:
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package varnish.x86_64 0:3.0.7-1.el6 will be installed
--> Processing Dependency: varnish-libs = 3.0.7-1.el6 for package: varnish-3.0.7-1.el6.x86_64
--> Processing Dependency: for package: varnish-3.0.7-1.el6.x86_64
--> Processing Dependency: for package: varnish-3.0.7-1.el6.x86_64
--> Running transaction check
---> Package varnish-libs.x86_64 0:3.0.7-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

 Package             Arch          Version             Repository          Size
 varnish             x86_64        3.0.7-1.el6         varnish-3.0        445 k
Installing for dependencies:
 varnish-libs        x86_64        3.0.7-1.el6         varnish-3.0         42 k

Transaction Summary
Install       2 Package(s)

Total download size: 487 k
Installed size: 1.2 M
Downloading Packages:
Total                                           1.1 MB/s | 487 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction

  Installing : varnish-libs-3.0.7-1.el6.x86_64                              1/2 

  Installing : varnish-3.0.7-1.el6.x86_64                                   2/2 

  Verifying  : varnish-libs-3.0.7-1.el6.x86_64                              1/2 

  Verifying  : varnish-3.0.7-1.el6.x86_64                                   2/2 

  varnish.x86_64 0:3.0.7-1.el6                                                  

Dependency Installed:
  varnish-libs.x86_64 0:3.0.7-1.el6                                             


Step 3 – Make few changes in  configuration so Varnish can run properly. By default, the configuration is set as following:



Now scroll down and you can see the options to Adjust the values :










Edit all the values as recommended . Also you can see that Varnish Storage Size recommendation is 1 GB . Make sure you have more than 1 GB RAM on your Server. If you have 1 GB RAM then you can set it to 256MB or 512 MB. In my case I will set it as 1GB as i have 5 GB ram on the server.








Click on Save Changes . You can see the message Data Updated.






This means CentOs Web Panel has updated all Virtual Host entries adjusting its port to 82 (Apache).


Cheap web Hosting

Basic Configuration for CentOS Web Panel (CWP)

Cheap reseller Hosting


Make sure you have  install CWP on your server  and login to CWP dashboard as root or a user with root privilege via


1. Setup Nameservers

A nameserver is a computer that is permanently connected to the Internet and translates domain names into IP addresses (or vice versa), enabling you to enter  instead of When registering a domain name, you will need (at least) two nameservers configured to handle requests for the domain name in question. You will need to register your private nameserver at your domain registrar panel.

In CentOS Web Panel (CWP) you can define your default NS by going to DNS Functions >> Edit Nameservers IPs. Enter your desired Nameservers and put your server’s IP next to each followed by clicking Save Changes button.







Click on Save Changes .






2. Setup Shared IP for websites

Go to CWP Settings then Edit Settings.

Enter your current server IP or free unused IP. Leave Apache port to 80 by default if  Varnish is not yest activated. Do not forget to enter your valid email address in the Root Email field.








Click on Save Changes .





3. Setup A Hosting Package

Go to  Packages and Add a Package. Next, give that package a name and define several limitations followed by clicking the Create button.:













Once done, you’ll just see a message saying Data Updated!

You can verify the Package from List Package :





4. Create a User Account

Go to User Accounts menu then click New Account. Fill up all the information needed .

















Click on Create .


















You can verify the Account creation for Lists Accounts :







5. Install Softaculous :

Go to Script Installer > Script Manager > then click the Install Softaculous button.





Click on Install Softaculous .

You’ll then see this message:




Once the Installation is complated you can see an option of Softaculous listed in Script Manager :





That’s all. If you have any suggestion? Do not hesitate to comment.


Cheap web Hosting

How to transfer website from cPanel server to CWP (CentOS Web Panel server)?

Cheap reseller Hosting

centos-web-panelFirst Install CWP on your VPS or Dedicated server : Installation Process


Configuration of CentosWebPanel
– Setup nameservers (CWP *- > DNS Functions -*> Edit Nameservers IPs)
– Setup shared ip (CWP –> WebPanel Settings – -> WebPanel Settings)
– Setup at least one hosting package (CWP –> Accounts –> Add a Package)
– Setup root email (CWP –> WebPanel Settings – -> WebPanel Settings)

How to Setup NameServers?
You can setup your own nameserver but then you need to have at least two IPs or you can use FreeDNS:

You can use one of the Free DNS server providers like:

When you register on Free DNS providers site there you will get Nameservers that you can use for yours domains.
Nameservers you need to add in: CWP – > DNS Functions -> Edit Nameservers IPs
* This nameservers you enter here will be used in all configs and account setups

If you are using FreeDNS service than you will need to point yours domain to nameservers that you get on FreeDNS  website.
On FreeDNS Website you need to point domain to your server IP address.
This changes will need up to 24 hours to be visible for you.

Create New Account
– Accounts –> New Account
– SQL Services –> MySQL Manager (New Database & User)

Download Data from cPanel server
– Download all files from yours cPanel servers /home/username/public_html folder
– Download MySQL Database with phpMyAdmin from cPanel server

Upload Data to CWP server and import MySQL database

– with FTP or SSH uplaod all files to your CWP server in /home/username/public_html folder you created before with new account
– with phpMyAdmin on CWP import database you downloaded (with logins details of mysql user)
* You can zip .sql file and import it much faster

Edit yours config files that connects to MySQL database on CWP
eg. for wordpress /home/public_html/wp-config.php  (check: host, username, database and password)

and that is it, test your website.

If you use mod rewrite and .htaccess for your website than you will need to add this in your vhost file (change USERNAME)

<Directory "/home/USERNAME/public_html">
AllowOverride All

add this config beffore </VirtualHost> for your domain


Cheap web Hosting

How to install CentOS Web Panel on Dedicated & VPS Server.

Cheap reseller Hosting


CentOS Web Panel – Free Web Hosting control panel is designed for quick and easy management of (Dedicated & VPS) servers without of need to use ssh console for every little thing. There is lot’s of options and features for server management in this control panel.

CWP is really considered feature-rich. Some of notable features including:

– Apache Web Server (Mod Security + OWASP rules optional)
– PHP 5.4 (suPHP, SuExec + PHP version switcher)
– MySQL + phpMyAdmin
– Postfix + Dovecot + roundcube webmail (Antivirus, Spamassassin optional)
– CSF Firewall
– File System Lock (no more website hacking, all your files are locked from changes)
– Backups (optional)
– AutoFixer for server configuration
– Varnish Cache server (improve your server performances by 3x)
– Compiles Apache from source (improves up to 15% on performances)
– Apache reCompiler + Additional modules install with one click
– Apache server status, configuration
– Edit apache vhosts, vhosts templates, include configuration
– Rebuild all apache Virtual hosts with one click
– suPHP & suExec (improved security)
– Mod Security + OWASP rules (one click install, easy management)
– Tomcat 8 server management & install in one click
– DoS protection from the Slow-Loris attacks
– Compiles PHP from source (improves up to 20% on performances)
– PHP switcher (switch between PHP versions like: 5.2, 5.3, 5.4, 5.5)
– Simple php editor
– PHP addons with one click
– PHP.ini editor & PHP info & List modules
– php.ini per user account (you can add changes in /home/USER/php.ini)
– postfix & dovecot
– MailBoxes, Alias
– Roundcube webmail
– Postfix Mail queue
– rDNS Checker Module (check you rDNS records)
– AntiSPAM (Spamhaus cronjob)
– Re-Build Postfix/Dovecot Mail server with (AntiVirus, AntiSpam Protection)
– Email Auto Responder
– MySQL Database Managment
– Add local or remote access user
– Live Monitor MySQL process list




A server / VPS running CentOS 6 (at the time of writing it still does not support CentOS 7). Clean minimal install is recommended. Need recommendation? try Hostripples or Hostdens.

Basic knowledge about most common Unix command to manage a Linux VPS.

Any favorite SSH client like Putty or simply Terminal if you’re using Linux or Mac.

Make sure your VPS is running CentOS 6 with no LAMP component installed (Apache, MySQL, PHP)


How to Install CWP

Follow steps below to setup CentOS Web Panel on your VPS:


Step 1 – Login to your server as root




Step 2 – Go to /usr/local/src directory and download CWP installer package

cd /usr/local/src



Step 3 – Start Installation using below command in screen :



sh cwp-latest

If screen is not install then you can install it using

yum install screen


Just wait for some time till get get install .

The CWP will take some times for installation as several software will be compiled from source for improved performance, security and flexibility.Once its completed you can see below screen :











Make sure you copy all the details mention on the scree.

Step 4 – Now hit Enter and your server should reboot automatically. Next time you  login to your server via SSH, you will now see CWP welcome message.









Step 5 – Open up your web browser (Firefox, Chrome,Safari,Opera etc) and open your newly installed CWP admin GUI at one of these URLs:

http://your-ip-address:2030 or https://your-ip-address:2031



CWP uses the same login details you used to SSH your server .

CentOS Web Panel GUI: Dashboard.



Cheap web Hosting