Monthly Archives: March 2018

How to work with CentOS Web Panel File Manager

File Manager is a free utility that comes with CentOS Web Panel. 

cwp file manager

To access CWP File Manager:

  1. Log in to CWP as root
  2. Click the File Manager at top of the web panel. A new web browser window will open.
  3. The interface is very similar to Windows File Explorer. You can create/delete directories, create/delete/edit files, change permissions for directories/files etc.
  4. Once done working with your directories/files, just close the File Manager window.

The movie tutorial for this tutorial:

Share this post:

Set up an SSL certificate for hostname on CentOS Web Panel

This tutorial doesn’t work anymore! (September 26, 2018)

If you just installed the CentOS Web Panel (see the link at the end of this article) you probably want to set up an SSL certificate for the server’s hostname. First all all, be sure to point the hostname to the server’s IPs/nameservers.

cwp ssl hostname

To set up an SSL certificate for hostname:

  1. Log in to CWP as root
  2. Navigate to User Accounts-> New Account
  3. Enter the details for the new account. For the Domain name enter the hostname (e.g. cwp-server.domain.com). 
  4. Click the Create button
  5. Go to Apache Settings->SSL Cert Manager.
  6. Look for AutoSSL tab/section. Choose the previously created username, the hostname domain and click the Install SSL button. You will see a message like AutoSSL installation for domain cwp1.plothost.com success!
  7. At the bottom of the page you will see the certification details :

    DocumentRoot: /home/cwp1/public_html
    SSLCertificateFile: /etc/pki/tls/certs/cwp1.plothost.com.cert
    SSLCertificateKeyFile: /etc/pki/tls/private/cwp1.plothost.com.key
    SSLCertificateChainFile: /etc/pki/tls/certs/cwp1.plothost.com.bundle

  8. Open the CWP File Manager and navigate to file  /usr/local/cwpsrv/conf/cwpsrv.conf. Click on the file to select it and then on the Edit button. 
  9. In the cwpsrv.conf file, change the name of the certificate and certificate key from the default:
     ssl_certificate /etc/pki/tls/certs/hostname.crt; 
     ssl_certificate_key /etc/pki/tls/private/hostname.key;

    to the names from step 7. In our case these are:

     ssl_certificate /etc/pki/tls/certs/cwp1.plothost.com.cert; 
     ssl_certificate_key /etc/pki/tls/private/cwp1.plothost.com.key;
  10. Click the Save file button and close the CWP File Manager window.
  11. Now go to CWP Settings->Reboot Server and click the Reboot Server Now button.
  12. Wait for a few minutes and you will be able to connect to CWP via https://hostname:2087. This is it  🙂 

The movie tutorial for this KB web article:

YouTube video removed!

Notice that generating the same certificate multiple times can lead at some point to Let’s Encrypt Authority errors. During testing, we got this error at one point:

[Fri Mar 23 15:57:42 EDT 2018] Sign failed: "detail":"Error creating new cert :: too many certificates already issued for exact set of domains: cwp.plothost.com: see https://letsencrypt.org/docs/rate-limits/"
[Fri Mar 23 15:57:42 EDT 2018] Please check log file for more details: /root/.acme.sh/acme.sh.log

Related KB article: How to install CentOS Web Panel

Share this post:

Not all files showing in FTP client

You have a lot of files (thousands or millions) in a directory and your FTP client do not show all of them? Find out that the issue has nothing to do with your FTP client.
The FTP server is the one that decides how many files to show.

For example for pure-ftp (a very popular FTP server for cPanel servers) the limit is 10000. You can modify this value anytime according to your needs by editing the file /etc/pure-ftpd.conf and set the maximum number of files to be displayed:

# 'ls' recursion limits. The first argument is the maximum number of
# files to be displayed. The second one is the max subdirectories depth

LimitRecursion 10000 8

Don’t forget to restart the FTP server (in our case for pure-ftp server):

root@web [~]# service pure-ftpd restart
If you want to see more files in the FTP client and you don’t have root access, you should contact your host.
Notice that for large number of files, the FTP client will take some time to list all of them.
The number of files you will effectively see is the number in the ftp server configuration-2. In Unix systems all directories contain two special entries . (directory itself) and .. (for parent directory).
Share this post:

View hidden files in FileZilla

There are many articles online related to this FileZilla Option: Server->Force showing hidden files

filezilla show hidden files

Notice that this option is deprecated (it uses the LIST -a command which is deprecated). On nowadays FTP servers this option has no effect. Modern servers use MLSD command for directory listings. So if the server knows this command, FileZilla (and other FTP clients) will use it by default.

As a client, you can’t tell to a server that is using MLSD command to show hidden files. 
So, if you can’t see hidden files in your FTP client (files like .htaccess etc.), you should contact your host and ask for help.

Related KB article: Use FileZilla to connect via FTP to your web hosting account

Share this post:

Ports used by CentOS Web Panel

The main ports to access 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 interface 2030 or 2086
CentOS Web Admin Panel secure interface 2031 or 2087
CentOS Web User Panel interface 2082
CentOS Web User Panel secure interface 2083

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. :

SSH 22
FTP 21
SMTP 25/26
Secure SMTP 465
POP3 110
Secure POP3 995
MySQL 3306
IMAP 143
Secure IMAP 993
HTTP/HTTPS 80/443

 

Related KB article: How to install nano editor with yum

Share this post:
Page 2 of 3
1 2 3