22 Feb 2021

How To Install ClamAV On A CPanel Server

Steps To Install ClamAV On A CPanel Server

Here I’m explaining the steps to install ClamAV on a cPanel server. Before proceeding with this, first you need to make sure WHM plugin clamavconnector is not installed. Check WHM >> Manage plugins

1: If you would like to verify ClamAV’s digital signatures on the virus definition files as they are updated through freshclam, you need to install GMP first.

# /scripts/ensurerpm gmp gmp-devel bzip2-devel

2: Adding user and group for clamav

# useradd clamav
# groupadd clamav

Note: Don’t worry if the user and/or group already exists.

3: Create and chown clamav directory

# mkdir /usr/local/share/clamav
# chown clamav. /usr/local/share/clamav

4: Download the latest ClamAV from http://www.clamav.net/

# wget http://www.clamav.net/downloads/production/clamav-0.99.tar.gz
# tar -xvzf clamav-0.99.tar.gz
# cd clamav-0.99
# ./configure --disable-zlib-vcheck
# make
# make install

#mv -fv /usr/local/etc/freshclam.conf.sample /usr/local/etc/freshclam.conf

5: Comment out “Example” line in /usr/local/etc/freshclam.conf

[email protected] [/]# cat /usr/local/etc/freshclam.conf | grep -i example
## Example config file for freshclam

#mv -fv /usr/local/etc/clamd.conf.sample /usr/local/etc/clamd.conf

6: Comment out “Example” line in /usr/local/etc/clamd.conf

[email protected] [/]# cat /usr/local/etc/clamd.conf | grep -i example
## Example config file for the Clam AV daemon

7: Change the “LocalSocket” to /tmp/clamd in /usr/local/etc/clamd.conf

[email protected] [/]# grep LocalSocket /usr/local/etc/clamd.conf
LocalSocket /tmp/clamd.socket

8: Run ldconfig to create the necessary links and cache to the most recent shared libraries

# ldconfig

9: Run freshclam to download the latest definitions

# freshclam

10: Init script for CentOS/CloudLinux upto/including version 6.x

# curl https://download.configserver.com/clamd -o /etc/init.d/clamd
# chown root:root /etc/init.d/clamd
# chmod +x /etc/init.d/clamd
# chkconfig clamd on
# service clamd restart

11: Init script for CentOS/CloudLinux version 7.x

# rm -fv /etc/init.d/clamd
# curl https://download.configserver.com/clamd.service -o /usr/lib/systemd/system/clamd.service
# systemctl daemon-reload
# systemctl enable clamd.service
# systemctl restart clamd.service

12: Add service to /etc/chkserv.d/clamav

[email protected] [/]# cat  /etc/chkserv.d/clamav
service[clamav]=x,x,x,service clamd restart,clamd,root

13: Creating log files for ClamAV updates

# touch /var/log/clam-update.log
# chown clamav:clamav /var/log/clam-update.log

14: Add ClamAV to chkservd

[email protected] [/]# cat  /etc/chkserv.d/chkservd.conf | grep clamav
19 Mar 2018

Installing and configuring ClamAV for cPanel server

WHM comes with a free, pre-installed version of clamavconnector (Clam antivirus) that is not activated by default.

Activate it by following this procedure:

  1. Connect to your WHM interface as root.
  2. On the home page, click on the cPanel link (icon).
  3. Click on “Manage Plugins”.
  4. Select the box “Install and keep updated” in the corresponding section to clamavconnector.
  5. Click on save at the bottom of the page to confirm the installation.

WHM will then download the necessary packages for clamavconnector and will install it automatically,  this may take a few minutes.

Once the installation has been completed, you will have a virus scan link in your cPanel interface.

Please go through the relevant screen captures:




That’s it !!!

23 Nov 2017

Upgrading MySQL from 5.1 to 5.5 in a cPanel server

MySQL is an open source RDBMS (Relational Database Management System) and its using the SQL Language(Structured Query Language). A database is a structured collection of data. SQL is the most commonly using language for database operations. By using SQL the database operations like adding, accessing and managing the database is very simple.

The MySQL upgrading steps is quite difficult normally. Like all software, the first steps for MySQL upgrade is taking the backup. Yes! it’s a very important step. In a cPanel installed server you can upgrade the MySQL version from the command line itself by using the script “/scripts/check_cpanel_rpms”.

Here is short look for upgrading your MySql from 5.1 to 5.5 in a cPanel server.

1. Take the backup of all the databases on the server.

2. Replace the MySQL version from 5.1 with 5.5 in /var/cpanel/cpanel.config file

#vi /var/cpanel/cpanel.config
and then, change 
"mysql-version=5.1" to "mysql-version=5.5".

3. Then, run

#/scripts/check_cpanel_rpms --fix
 4. After executing this command, try

#mysql -V

MySQL will be upgraded to 5.5. Then try, php -v. You will get the following error:

[email protected] [~]# php -v
php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

Do an easyapache to fix this.



14 Nov 2017

How to change the Apache port via command line in cpanel?

In a cPanel server the port value for the web server Apache is defined in the configuration file ‘/var/cpanel/cpanel.config‘. You can change the default value from this configuration file.

Please do follow the steps below to change it from command line interface:

Step 1: Open the configuration file by using your favorite text editor and find the directive ‘apache_port’

# vim /var/cpanel/cpanel.config


Step 2 : Change the port number

Here, 80 is the default port value. You can change it to your own custom value.

Step 3 : Run this script for it to take effect

# /usr/local/cpanel/whostmgr/bin/whostmgr2 –updatetweaksettings

Check the httpd conf file ‘/usr/local/apache/conf/httpd.conf‘ for finding any occurrences of default port (80) and run the following script to make httpd conf is up to date.

# /scripts/rebuildhttpdconf

That’s it!!

©2021 Tranzmedia Netvision Limited. All Rights Reserved.