How Pagebara finds ClamAV
Pagebara talks to the ClamAV service, clamd, on this device: at 127.0.0.1, port 3310. Set PAGEBARA_CLAMD_PORT for another port, or PAGEBARA_CLAMD_SOCKET to use a Unix socket instead. The steps below start clamd on port 3310, listening on this device only. ClamAV does not protect that port with a password, so keep TCPAddr at 127.0.0.1 and never open it to the network.
ClamAV needs its signatures before it starts. The first download is large and can take some minutes.
macOS
- 01
Install ClamAV with Homebrew:
brew install clamav - 02
Make the two configuration files from the examples Homebrew installs:
cd "$(brew --prefix)/etc/clamav" cp freshclam.conf.sample freshclam.conf cp clamd.conf.sample clamd.confIn both files, delete the line that says
Example. Then add these lines toclamd.conf:TCPSocket 3310 TCPAddr 127.0.0.1 - 03
Download the signatures, then start the service now and at every login:
freshclam sudo brew services start clamav
Debian and Ubuntu
- 01
Install the service and the signature updater:
sudo apt install clamav-daemon clamav-freshclamThe updater downloads the signatures, and
clamdstarts once they are there. - 02
Add these lines to
/etc/clamav/clamd.conf, then restart the service:TCPSocket 3310 TCPAddr 127.0.0.1sudo systemctl restart clamav-daemonOr leave the file as it is and use the Unix socket the package sets up: its path is on the
LocalSocketline of the same file, and Pagebara uses it when started withPAGEBARA_CLAMD_SOCKETset to that path.
On other distributions the packages have other names; the configuration lines are the same.
Windows
- 01
Download the Windows installer from clamav.net and run it.
- 02
In PowerShell, in the folder ClamAV was installed to, make the configuration files:
copy .\conf_examples\freshclam.conf.sample .\freshclam.conf copy .\conf_examples\clamd.conf.sample .\clamd.confOpen each file in Notepad and delete the line that says
Example. Then add these lines toclamd.conf:TCPSocket 3310 TCPAddr 127.0.0.1 - 03
Download the signatures, then start the service:
.\freshclam.exe .\clamd.exe
Check that it works
Open any PDF in Pagebara and choose Document security beside Save. With ClamAV running, the Malware scan line offers Scan this PDF, and a switch to scan every PDF before it opens. The same switch is in Settings, System.
From a terminal on macOS or Linux, ClamAV answers PONG:
printf 'zPING\0' | nc 127.0.0.1 3310For ClamAV itself, see its documentation. For what Pagebara checks without it, see how Pagebara checks PDFs.