ClamAV - Could not connect

Hi all,

I have installed Axigen on a CentOS 8 and then I used the following link to configure ClamAV:
https://www.adminbyaccident.com/security/how-to-install-the-clamav-antivirus-on-centos-8/

ClamAV and Freshclam are running:

$ sudo systemctl status clamd@scan
● clamd@scan.service - clamd scanner daemon
Loaded: loaded (/usr/lib/systemd/system/clamd@.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2020-09-08 15:56:03 UTC; 18h ago
Docs: man:clamd(8)
man:clamd.conf(5)
https://www.clamav.net/documents/
Process: 44126 ExecStart=/usr/sbin/clamd -c /etc/clamd.d/scan.conf (code=exited, status=0/SUCCESS)
Main PID: 44133 (clamd)
Tasks: 2 (limit: 24848)
Memory: 1.0G
CGroup: /system.slice/system-clamd.slice/clamd@scan.service
└─44133 /usr/sbin/clamd -c /etc/clamd.d/scan.conf

Sep 09 09:16:26 AXIGEN1 clamd[44133]: SelfCheck: Database status OK.
Sep 09 09:26:26 AXIGEN1 clamd[44133]: SelfCheck: Database status OK.
Sep 09 09:36:26 AXIGEN1 clamd[44133]: SelfCheck: Database status OK.
Sep 09 09:46:26 AXIGEN1 clamd[44133]: SelfCheck: Database status OK.
Sep 09 09:56:26 AXIGEN1 clamd[44133]: SelfCheck: Database status OK.
Sep 09 10:06:26 AXIGEN1 clamd[44133]: SelfCheck: Database status OK.
Sep 09 10:16:26 AXIGEN1 clamd[44133]: SelfCheck: Database status OK.
Sep 09 10:26:27 AXIGEN1 clamd[44133]: SelfCheck: Database status OK.
Sep 09 10:36:27 AXIGEN1 clamd[44133]: SelfCheck: Database status OK.
Sep 09 10:46:27 AXIGEN1 clamd[44133]: SelfCheck: Database status OK.

$ sudo systemctl status clam-freshclam.service
● clam-freshclam.service - freshclam scanner
Loaded: loaded (/usr/lib/systemd/system/clam-freshclam.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2020-09-08 15:29:07 UTC; 19h ago
Main PID: 39248 (freshclam)
Tasks: 1 (limit: 24848)
Memory: 5.2M
CGroup: /system.slice/clam-freshclam.service
└─39248 /usr/bin/freshclam -d -c 4

Sep 08 15:29:07 AXIGEN1 systemd[1]: Starting freshclam scanner…
Sep 08 15:29:07 AXIGEN1 systemd[1]: Started freshclam scanner.

But in “Antivirus & Antispam” section, ClamAV status is set to “Could not connect”:

Any idea?

Thank you,
Regards.

What port is being used?
You might want to check, where axigen expects to find clamav, verify in /var/opt/axigen/run/axigen.conf, search for clamav and the port which axigen thinks should be used.
Then verify with ClamAv, which port it is using (netstat -ltpan | grep clam)

I vaguely remember having had issues with that.

Hi I am using these commands for centos 7.

yum -y install clamav clamav-scanner-systemd clamav-update

vi /etc/clamd.d/scan.conf

8 #Example
109 TCPSocket 3310
117 TCPAddr 127.0.0.1
207 User axigen

vi /etc/freshclam.conf

8 #Example
56 DatabaseOwner axigen

chown -R axigen:axigen /var/run/clamd.scan/
chown -R axigen:axigen /var/lib/clamav/
systemctl start clamd@scan
systemctl enable clamd@scan
setsebool -P antivirus_can_scan_system 1
netstat -tlpn | grep clam
ps aux | grep clam
freshclam

Thank you all for your response!