From 90be33d2267d34c5518ec00da80a4e86dd397bf5 Mon Sep 17 00:00:00 2001 From: Junxiang Huang Date: Wed, 24 Apr 2024 16:28:09 +0800 Subject: [PATCH] update --- manual/deploy_pro/deploy_clamav_as_daemon.md | 148 ------------------ .../pro-edition/deploy_clamav_with_docker.md | 41 ----- 2 files changed, 189 deletions(-) delete mode 100644 manual/deploy_pro/deploy_clamav_as_daemon.md delete mode 100644 manual/docker/pro-edition/deploy_clamav_with_docker.md diff --git a/manual/deploy_pro/deploy_clamav_as_daemon.md b/manual/deploy_pro/deploy_clamav_as_daemon.md deleted file mode 100644 index 03604402..00000000 --- a/manual/deploy_pro/deploy_clamav_as_daemon.md +++ /dev/null @@ -1,148 +0,0 @@ -# Run ClamAV as a Daemon - -## For Ubuntu 16.04 - -### Install clamav-daemon & clamav-freshclam - -``` -apt-get install clamav-daemon clamav-freshclam -``` - -You should run Clamd with a root permission to scan any files. -Edit the conf `/etc/clamav/clamd.conf`,change the following line: - -``` -LocalSocketGroup root -User root -``` - -### Start the clamav-daemon - -``` -systemctl start clamav-daemon -``` - -* Test the software - -``` -$ curl https://www.eicar.org/download/eicar.com.txt | clamdscan - -``` - -The output must include: - -``` -stream: Eicar-Test-Signature FOUND -``` - -## For CentOS 7 - -### Install Clamd - -``` -yum install epel-release -yum install clamav-server clamav-data clamav-filesystem clamav-lib clamav-update clamav clamav-devel -``` - -### Run freshclam - -* Configure the freshclam to updating database - -``` -cp /etc/freshclam.conf /etc/freshclam.conf.bak -sed -i '/^Example/d' /etc/freshclam.conf -``` - -* Create the init script - -``` -cat > /usr/lib/systemd/system/clam-freshclam.service << 'EOF' -# Run the freshclam as daemon -[Unit] -Description = freshclam scanner -After = network.target - -[Service] -Type = forking -ExecStart = /usr/bin/freshclam -d -c 4 -Restart = on-failure -PrivateTmp = true - -[Install] -WantedBy=multi-user.target - -EOF -``` - -* Boot up - -``` -systemctl enable clam-freshclam.service -systemctl start clam-freshclam.service -``` - -### Configure Clamd - -``` -cp /usr/share/clamav/template/clamd.conf /etc/clamd.conf -sed -i '/^Example/d' /etc/clamd.conf -``` - -You should run Clamd with a root permission to scan any files. -Edit the `/etc/clamd.conf`,change the following line: - -``` -User root -... -LocalSocket /var/run/clamd.sock -``` - -### Run Clamd - -* Create the init script - -``` -cat > /etc/init.d/clamd << 'EOF' -case "$1" in - start) - echo -n "Starting Clam AntiVirus Daemon... " - /usr/sbin/clamd - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd - ;; - stop) - echo -n "Stopping Clam AntiVirus Daemon... " - pkill clamd - rm -f /var/run/clamav/clamd.sock - rm -f /var/run/clamav/clamd.pid - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd - ;; -esac - -EOF -``` - -``` -chmod +x /etc/init.d/clamd -``` - -* Boot up - -``` -chkconfig clamd on -service clamd start -``` - -* Test the software - -``` -$ curl https://www.eicar.org/download/eicar.com.txt | clamdscan - -``` - -The output must include: - -``` -stream: Eicar-Test-Signature FOUND -``` \ No newline at end of file diff --git a/manual/docker/pro-edition/deploy_clamav_with_docker.md b/manual/docker/pro-edition/deploy_clamav_with_docker.md deleted file mode 100644 index c54f15fd..00000000 --- a/manual/docker/pro-edition/deploy_clamav_with_docker.md +++ /dev/null @@ -1,41 +0,0 @@ -# Deploy Clamav with Docker - -## Add Clamav to docker-compose.yml - -The following section needs to be added to docker-compose.yml in the services section - -```yml -services: - ... - - av: - image: mkodockx/docker-clamav:alpine - container_name: seafile-clamav - networks: - - seafile-net -``` - -## Modify seafile.conf - -Add this to seafile.conf - -```conf -[virus_scan] -scan_command = clamdscan -virus_code = 1 -nonvirus_code = 0 -scan_interval = 5 -scan_size_limit = 20 -threads = 2 -``` - -## Restart docker container - -```shell -docker compose down -docker compose up -d -``` - -Wait some minutes until Clamav finished initializing. - -Now Clamav can be used.