Ports used by CentOS Web Panel

The main ports to access the CentOS Web Panel are 2030 and 2031.  Lately, CentOS Web Panel also uses ports 2086/2087 and 2082/2083 (similar to WHM). To summarize:

CentOS Web Admin Panel interface2030 or 2086
CentOS Web Admin Panel secure interface2031 or 2087
CentOS Web User Panel interface2082
CentOS Web User Panel secure interface2083

These ports are configured in the file /usr/local/cwpsrv/conf/cwpsrv.conf . You can check this file via command line with a utility like nano, or via the CentOS Web Panel File Manager. The contents of the cwpsrv.conf file is:

worker_processes  2;
events {
    worker_connections  2048;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server_tokens off;
    client_max_body_size 128M;

    access_log  logs/access_log;
 
    server {
        listen       2030;
        listen       2086;
        server_name  localhost;

        location / {
            root   /usr/local/cwpsrv/htdocs/admin;
            index  index.html index.htm index.php;
            ModSecurityEnabled off;
            ModSecurityConfig /usr/local/cwpsrv/conf/security/conf/global_rules.conf;

            # Includes
            include /usr/local/cwpsrv/conf/cwp_rewrite.conf;
            include /usr/local/cwpsrv/conf/cwp_services.conf;
            include /usr/local/cwpsrv/conf/include/*.conf;
            include /usr/local/cwpsrv/conf/cwp_panels.conf;

            location ~ \.php$ {
                try_files $uri =404;
                root /usr/local/cwpsrv/htdocs/admin;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_read_timeout 600;
                fastcgi_pass    unix:/usr/local/cwp/php71/var/sockets/cwpsrv.sock;
                fastcgi_index   index.php;
                fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_param   SCRIPT_NAME   $fastcgi_script_name;
                include                 fastcgi_params;
            }
        }
    }

    server {
        listen       2031;
        listen       2087;
        server_name  localhost;

        ssl                 on;
        ssl_session_timeout 90m;
        ssl_certificate     /etc/pki/tls/certs/hostname.crt;
        ssl_certificate_key /etc/pki/tls/private/hostname.key;
        ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers         HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers   on;
	error_page 497  https://$host:2087$request_uri;

        location / {
            root   /usr/local/cwpsrv/htdocs/admin;
            index  index.html index.htm index.php;
            ModSecurityEnabled off;
            ModSecurityConfig /usr/local/cwpsrv/conf/security/conf/global_rules.conf;

            # Includes
            include /usr/local/cwpsrv/conf/cwp_rewrite.conf;
            include /usr/local/cwpsrv/conf/cwp_services.conf;
            include /usr/local/cwpsrv/conf/include/*.conf;
            include /usr/local/cwpsrv/conf/cwp_panels.conf;

            location ~ \.php$ {
                try_files $uri =404;
                root /usr/local/cwpsrv/htdocs/admin;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_read_timeout 600;
                fastcgi_pass    unix:/usr/local/cwp/php71/var/sockets/cwpsrv.sock;
                fastcgi_index   index.php;
                fastcgi_param   SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                fastcgi_param   SCRIPT_NAME   $fastcgi_script_name;
                include                 fastcgi_params;
            }
        }
    }
    include /usr/local/cwpsrv/conf.d/*.conf;
}

To redirect the non-secure ports to secure ports add the following lines to the file /usr/local/apache/htdocs/.htaccess

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

CentOS Web Panel uses the standard ports for services like the email server, SSH etc. :

SSH22
FTP21
SMTP25/26
Secure SMTP465
POP3110
Secure POP3995
MySQL3306
IMAP143
Secure IMAP993
HTTP/HTTPS80/443

Related KB article: How to install nano editor with yum

This Post Has 3 Comments

  1. Math

    Hi, but how did you change the users’ connection ports?

  2. Editorial Staff

    Hello,
    We don’t have a CWP server at this time, but I doubt you can change this from the interface. Please ask on CWP forums.
    Thanks.

  3. Lois

    Hello,
    I want to ask, can we change http port, in cwp panel ?

Leave a Reply