How to Install CentOS Web panel(CWP) on CentOS 6

There are many open source control panel to run linux web hosting on the internet like ISPConfig, Webmin, Virtualmin and Open Panel. In this post, I want to share how to install CentOS Web panel (CWP) on CentOS 6. CentOS Web panel is a free Web Hosting panel designed for easy management of servers ( VPS & Dedicated ) without the need to use their expertise and knowledge in the linux command line and without SSH access to the server.

From the CWP official website, they do not provide uninstaller and reinstall the server to remove it. CWP should be install on the fresh CentOS operating system without any non-default configuration.

Follow the following step to install CWP on CentOS 6.6.

1. Install Fresh CentOS 6.6 with direct internet connection :
2. Allocate atleast 512MB RAM for 32 bit systems and 1024MB for 64 bit systems. In this example we will allocate 4GB RAM.

3. Configure your server hostname :
a. Modify the hostname and reboot the server to take effect:

# vi /etc/sysconfig/network

a. Verify hostname :

[root@centos66 ~]# hostname

4. Update your server before begin. Reboot the server to take effect the changes :

# yum update -y

5. Install CWP:
a. Change directory to /usr/local/src/ directory:

# cd /usr/local/src

b. Download the installer via wget :

# wget

Or try the following URL if above url not working :

# wget

c. Start CWP installer

# sh cwp-latest

6. The installation will take up to 50 minutes, depend on your internet connection speed :


7. Once the installation completed, you will see the the screen below. In this case i leave mySQL root password blank.

Press Enter to reboot the server.

8. Go to your browser and enter CWP ip address with 2030 port number. You will see login page as below. CentOS WebPanel Admin GUI at http://SERVER-IP:2030/

Username: root
Password: your server root password


9. You can start configure your CWP via dasgboard panel below. Get consult from official website, and the CWP forum to proceed the configuration.


10. You can start configure your CWP server and then start hosting your website.

  • Setup nameservers
  • Setup shared ip (must be your public IP address)
  • Setup at least one hosting package (or edit default package)
  • Setup root email
  • & now you are ready to host domains…

11. Install Softaculous Apps Installer via command :

# /usr/local/src/ --quick
 Welcome to Softaculous Apps Installer

// 1) CONFIGURING universal.php
// 3) UPDATING Categories
// 4) UPDATING Scripts List
// 5) UPDATING Installed Scripts List

ln: creating symbolic link `/usr/local/cwpsrv/conf.d/softaculous.conf': File exists
cwpsrvd: Could not reliably determine the server's fully qualified domain name, using centos66.ehowstuff.local for ServerName
Congratulations, Softaculous was installed successfully
Softaculous has been installed at:
Path : /usr/local/softaculous
Scripts Path : /var/softaculous

We request you to please register for updates and notifications at :
It also inspires us when you register. Registration is free and just a one minute job.

If you need any support you can always count on us. Just drop in at our Support Board:
Alternatively, you can contact us via Email at

Thank you for using Softaculous

How to Enable Logging for Email Subject Fields in Postfix Maillog

Postfix MTA basically just capture ‘From’ and ‘To’ field while the subject is not logged to the maillog. There are simple steps to enable logging of the e – mail subject in postfix maillog. This will very useful for email administrators when performing troubleshooting of problems related with email.

1. Assume that postfix has been installed. Open the postfix main configuration file :
# vi /etc/postfix/
2. Uncomment the following :
header_checks = regexp:/etc/postfix/header_checks
3. Open /etc/postfix/header_checks file and add the following line at the bottom :
# vi /etc/postfix/header_checks
/^Subject:/     WARN
4. Run postmap to apply the new configuration in /etc/postfix/header_checks :
# postmap /etc/postfix/header_checks :
5. Restart or reload postfix configuration :
# service postfix restart


# postfix reload
6. Test send email with subject:test-ABC :
# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 centos66.ehowstuff.local ESMTP Postfix
250-SIZE 10240000
250 DSN
250 2.1.0 Ok
250 2.1.5 Ok
354 End data with .
250 2.0.0 Ok: queued as 196AD1FDEA
221 2.0.0 Bye
Connection closed by foreign host.
7. Please confirm that the subject “test – ABC” is appearing in the log :
# tail -f /var/log/maillog
Apr  6 23:41:28 centos66 postfix/smtpd[4919]: connect from localhost[::1]
Apr  6 23:41:58 centos66 postfix/smtpd[4919]: 196AD1FDEA: client=localhost[::1]
Apr  6 23:42:07 centos66 postfix/cleanup[4924]: 196AD1FDEA: warning: header subject:test-ABC from localhost[::1]; from= to= proto=ESMTP helo=
Apr  6 23:42:07 centos66 postfix/cleanup[4924]: 196AD1FDEA: message-id=<20150406154158.196AD1FDEA@centos66.ehowstuff.local>
Apr  6 23:42:07 centos66 postfix/qmgr[4914]: 196AD1FDEA: from=, size=365, nrcpt=1 (queue active)
Apr  6 23:42:09 centos66 postfix/smtpd[4919]: disconnect from localhost[::1]


How To Get Email Alerts for SSH Login on Linux Server

Enable SSH server on a virtual private server (VPS) will expose the server to the internet and provide opportunities for hacking activities, especially when VPS still using root as a primary access. VPS should be configured with a email alert automatically to each successful login attempts via SSH server . VPS server owner shall be notified of any SSH server access log, such as who, when and which source IP address. This is an important security concern for server owners to protect the server from unknown login attempts. This is because if hackers use brute force to log into your VPS via ssh then it can be very dangerous. In this article, I will explain how to set up an email alert to all SSH login users on linux CentOS 6, CentOS 7, RHEL 6 and RHEL 7.

1. Login to your server as root user :

2. Configure at alert from source global definitions (/etc/bashrc). This will enabled for root and normal users :

[root@vps ~]# vi /etc/bashrc

Add the following at the bottom of the files.

echo 'ALERT - Root Shell Access ( on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`"

3. Optionally you can enable alert for root only :

[root@vps ~]# vi .bashrc

Add the following at the bottom of /root/.bashrc :

echo 'ALERT - Root Shell Access ( on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`"

Full Configuration file example :

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
echo 'ALERT - Root Shell Access ( on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`"

4. Optionally you can enable alert for specify normal user (e.g skytech ) :

[root@vps ~]# vi /home/skytech/.bashrc

Add the following at the bottom of /home/skytech/.bashrc :

echo 'ALERT - Root Shell Access ( on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`"


How to Install Nginx 1.6.2 with PageSpeed on Linux CentOS 6

This article will show you the steps to install Nginx and ngx_pagespeed module on Linux CentOS 6 virtual private server (VPS). By using ngx_pagespeed, the speed of your website will be faster without installing any additional applications such as wordpress plugin and so on. This is because ngx_pagespeed have some Nginx module which rewrites your webpages to make them faster. Below steps has been tested on CentOS 6.5 and CentOS 6.6.

1. Install nginx PageSpeed dependencies :

yum install gcc-c++ pcre-devel pcre-devel zlib-devel make unzip openssl-devel

2. Download and install ngx_pagespeed and PSOL (PageSpeed Optimization Libraries) source code :

mkdir -p /etc/nginx/modules
cd /etc/nginx/modules
cd ngx_pagespeed-release-
tar xzvf

3. Download NGINX :

cd /etc/nginx/
tar xzvf nginx-1.6.2.tar.gz
cd nginx-1.6.2/

4. Compile and prepare environment for NGINX with ngx_pagespeed module support :

./configure --add-module=/etc/nginx/modules/ngx_pagespeed-release- --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/ --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-file-aio --with-http_spdy_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-mail --with-mail_ssl_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'

At the end of installation, you will get the following message :

  nginx path prefix: "/etc/nginx"
  nginx binary file: "/usr/sbin/nginx"
  nginx configuration prefix: "/etc/nginx"
  nginx configuration file: "/etc/nginx/nginx.conf"
  nginx pid file: "/var/run/"
  nginx error log file: "/var/log/nginx/error.log"
  nginx http access log file: "/var/log/nginx/access.log"
  nginx http client request body temporary files: "/var/cache/nginx/client_temp"
  nginx http proxy temporary files: "/var/cache/nginx/proxy_temp"
  nginx http fastcgi temporary files: "/var/cache/nginx/fastcgi_temp"
  nginx http uwsgi temporary files: "/var/cache/nginx/uwsgi_temp"
  nginx http scgi temporary files: "/var/cache/nginx/scgi_temp"

Note : Keep this information as you will need it if you plan to uninstall the NGINX.

Building the NGINX with ngx_pagespeed :


Install NGINX with ngx_pagespeed to the system :

make install

5. Create a Cache directory which will be written by Nginx.

mkdir /var/ngx_pagespeed_cache
chown nginx:nginx /var/ngx_pagespeed_cache

6. Configure NGINX (nginx.conf) and turn on pagespeed module :

pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;

# enable CoreFilters
pagespeed RewriteLevel CoreFilters;

# enable additional filter(s) selectively
pagespeed EnableFilters collapse_whitespace;
pagespeed EnableFilters lazyload_images;
pagespeed EnableFilters insert_dns_prefetch;
pagespeed EnableFilters prioritize_critical_css;
pagespeed EnableFilters collapse_whitespace;

7. Create an init script for Nginx.

vi /etc/init.d/nginx
# nginx        Startup script for nginx
# chkconfig: - 85 15
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /var/run/
# description: nginx is an HTTP and reverse proxy server
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop nginx

# Source function library.
. /etc/rc.d/init.d/functions

if [ -L $0 ]; then
    initscript=`/bin/readlink -f $0`

sysconfig=`/bin/basename $initscript`

if [ -f /etc/sysconfig/$sysconfig ]; then
    . /etc/sysconfig/$sysconfig

prog=`/bin/basename $nginx`

start() {
    echo -n $"Starting $prog: "

    daemon --pidfile=${pidfile} ${nginx} -c ${conffile}
    [ $RETVAL = 0 ] && touch ${lockfile}
    return $RETVAL

stop() {
    echo -n $"Stopping $prog: "
    killproc -p ${pidfile} ${prog}
    [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}

reload() {
    echo -n $"Reloading $prog: "
    killproc -p ${pidfile} ${prog} -HUP

upgrade() {

    configtest -q || return
    echo -n $"Starting new master $prog: "
    killproc -p ${pidfile} ${prog} -USR2

    for i in `/usr/bin/seq $UPGRADEWAITLOOPS`; do
        /bin/usleep $SLEEPMSEC
        if [ -f ${oldbinpidfile} -a -f ${pidfile} ]; then
            echo -n $"Graceful shutdown of old $prog: "
            killproc -p ${oldbinpidfile} ${prog} -QUIT

    echo $"Upgrade failed!"

configtest() {
    if [ "$#" -ne 0 ] ; then
        case "$1" in
    ${nginx} -t -c ${conffile} $FLAG
    return $RETVAL

rh_status() {
    status -p ${pidfile} ${nginx}

# See how we were called.
case "$1" in
        rh_status >/dev/null 2>&1 && exit 0
        configtest -q || exit $RETVAL
        rh_status >/dev/null 2>&1 || exit 0
        if rh_status >/dev/null 2>&1; then
        echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|upgrade|reload|status|help|configtest}"

exit $RETVAL
chmod 0755 /etc/init.d/nginx
chown root:root /etc/init.d/nginx

8. Start nginx and make it autostart at boot :

service nginx start
chkconfig nginx on

9. Check NGINX version and installed modules :

$ nginx -V
nginx version: nginx/1.6.2
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
TLS SNI support enabled
configure arguments: --add-module=/etc/nginx/modules/ngx_pagespeed-release- --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/ --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-file-aio --with-http_spdy_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-mail --with-mail_ssl_module --with-cc-opt='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic'

10. Testing the pagespeed module:

curl -I http://www.ehowstuff.local

You should see X-Page-Speed version in the headers:

HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
X-Pingback: http://www.ehowstuff.local/xmlrpc.php
Date: Thu, 01 Jan 2015 06:41:14 GMT
Cache-Control: max-age=0, no-cache

How to Install open-vm-tools in CentOS 6.6

Q. How to install open-vm-tools in linux CentOS 6.6 ?

A. VMware is announcing the release of large portions of VMware Tools for Linux, Solaris and FreeBSD guests under GPL and GPL-compatible licenses. VMware is also announcing the creation of the Open Virtual Machine Tools (“open-vm-tools”) project on Even-though CentOS 6 not on the recommendation list, you still able to install the third party VMware-Tools (open-vm-tools) via EPEL repo as below steps.

open-vm-tools is available with these operating systems:

  • Fedora 19 and later releases
  • Debian 7.x and later releases
  • openSUSE 11.x and later releases
  • Recent Ubuntu releases (12.04 LTS, 13.10 and later)
  • Red Hat Enterprise Linux 7.0 and later releases
  • SUSE Linux Enterprise 12 – available Q4 2014
  • CentOS 7
  • Oracle Linux 7

1. Prepare EPEL repo for CentOS 6.6

[root@centos66 ~]# rpm --import
[root@centos66 ~]# rpm -ivh

2. Simply run yum command to install open-vm-tools

[root@centos66 ~]# yum install open-vm-tools -y

Examples :

[root@centos66 ~]# yum install open-vm-tools -y
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base:
 * epel:
 * extras:
 * updates:
Resolving Dependencies
--> Running transaction check
---> Package open-vm-tools.x86_64 0:9.4.6-1.el6 will be installed
--> Processing Dependency: for package: open-vm-tools-9.4.6-1.el6.x86_64
--> Processing Dependency: for package: open-vm-tools-9.4.6-1.el6.x86_64
--> Processing Dependency: for package: open-vm-tools-9.4.6-1.el6.x86_64
--> Processing Dependency: for package: open-vm-tools-9.4.6-1.el6.x86_64
--> Running transaction check
---> Package libdnet.x86_64 0:1.12-6.el6 will be installed
---> Package libicu.x86_64 0:4.2.1-9.1.el6_2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

 Package                   Arch               Version                        Repository        Size
 open-vm-tools             x86_64             9.4.6-1.el6                    epel             402 k
Installing for dependencies:
 libdnet                   x86_64             1.12-6.el6                     epel              28 k
 libicu                    x86_64             4.2.1-9.1.el6_2                base             4.9 M

Transaction Summary
Install       3 Package(s)

Total download size: 5.3 M
Installed size: 20 M
Downloading Packages:
(1/3): libdnet-1.12-6.el6.x86_64.rpm                                         |  28 kB     00:00 [Errno 12] Timeout on (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
(2/3): libicu-4.2.1-9.1.el6_2.x86_64.rpm                                     | 4.9 MB     01:21
(3/3): open-vm-tools-9.4.6-1.el6.x86_64.rpm                                  | 402 kB     00:04
Total                                                                44 kB/s | 5.3 MB     02:04
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : libdnet-1.12-6.el6.x86_64                                                        1/3
  Installing : libicu-4.2.1-9.1.el6_2.x86_64                                                    2/3
  Installing : open-vm-tools-9.4.6-1.el6.x86_64                                                 3/3
  Verifying  : libicu-4.2.1-9.1.el6_2.x86_64                                                    1/3
  Verifying  : open-vm-tools-9.4.6-1.el6.x86_64                                                 2/3
  Verifying  : libdnet-1.12-6.el6.x86_64                                                        3/3

  open-vm-tools.x86_64 0:9.4.6-1.el6

Dependency Installed:
  libdnet.x86_64 0:1.12-6.el6                    libicu.x86_64 0:4.2.1-9.1.el6_2


3. Start vmtoolsd service :

[root@centos66 ~]# service vmtoolsd start

How to Check Opened Port on Linux VPS Server

By default, the linux operating system manages 65536 ports. If you run Virtual private Server (VPS) on linux platform, it is better to turn off any services or ports that you don’t actually need. This is to ensure your VPS server will not become avenues of attack for any security threats. Simply run these commands to easily see open ports on your Linux VPS server that are currently listening.

1. List opened ports with protocol name :

[root@vps-server ~]# netstat --listen --tcp

Examples :

[root@vps-server ~]# netstat --listen --tcp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 *:mysql                     *:*                         LISTEN
tcp        0      0 *:http                      *:*                         LISTEN
tcp        0      0 *:ftp                       *:*                         LISTEN
tcp        0      0 *:ssh                       *:*                         LISTEN

2. List opened ports with protocol number :

[root@vps-server ~]# netstat --listen --tcp -n

Examples :

[root@vps-server ~]# netstat --listen --tcp -n
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0      *                   LISTEN
tcp        0      0        *                   LISTEN
tcp        0      0        *                   LISTEN
tcp        0      0        *                   LISTEN

How to Check VPS Network Speed

Several important factors to consider before buying a Virtual Private Server (VPS) are Internet connection speed, I/O speed, CPU performance and the server or network uptime. Actually, you can get a complete comparison about the VPS performance at websites, but if you want a second opinion on how fast is your connection speed VPS, you can perform the speedtest by yourself. In this post I will share with you how to check the speed of network for Linux VPS. These steps have been tested on a CentOS 5 and CentOS 6 VPS hosted at different locations in the United States.

1. Test 100MB File on the CentOS 5 VPS located at North Carolina, USA :

# wget -O /dev/null -

Example :

# wget -O /dev/null -
--2012-04-19 17:40:00--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104857600 (100M) [application/octet-stream]
Saving to: `/dev/null'

100%[=======================================================>] 104,857,600 11.1M/s   in 9.1s

2012-04-19 17:40:09 (11.0 MB/s) - `/dev/null' saved [104857600/104857600]

FINISHED --2012-04-19 17:40:09--
Downloaded: 1 files, 100M in 9.1s (11.0 MB/s)

100Mbps port = 12.5M/s Maximum speed

2. Test 1GB File on the CentOS 6 VPS located at New York City, USA :

# wget -O /dev/null -
--2015-03-08 03:43:25--
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1073741824 (1.0G) [application/zip]
Saving to: â/dev/nullâ

100%[====================================>] 1,073,741,824 33.1M/s   in 37s

2015-03-08 03:44:02 (27.8 MB/s) - â/dev/nullâ

FINISHED --2015-03-08 03:44:02--
Downloaded: 1 files, 1.0G in 37s (27.8 MB/s)

1Gigabit port = 125 MB/s Maximum speed

VPS network speed