How to stop and disable some unnecessary services

Post Reply
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

If you have small RAM, you can stop and disable some services.

ClamAV (scan incoming emails against viruses, sometimes this service can take up to 2GB of RAM)

Code: Select all

systemctl stop clamav-daemon.service
systemctl disable clamav-daemon.service

systemctl stop clamav-freshclam.service
systemctl disable clamav-freshclam.service

sed -i "s/^CLAMD =/#CLAMD =/g" /etc/exim4/exim4.conf.template
systemctl restart exim4
SpamAssassin (scan incoming emails against spam):

Code: Select all

systemctl stop spamassassin.service
systemctl disable spamassassin.service

sed -i "s/^SPAMASSASSIN =/#SPAMASSASSIN =/g" /etc/exim4/exim4.conf.template
sed -i "s/^SPAM_SCORE =/#SPAM_SCORE =/g" /etc/exim4/exim4.conf.template
systemctl restart exim4
Dovecot (provide IMAP and POP3 access):

Code: Select all

systemctl stop dovecot.service
systemctl stop dovecot.socket
systemctl disable dovecot.service
ProFTPD (provides FTP access):

Code: Select all

systemctl stop proftpd.service
systemctl disable proftpd.service
Fail2ban (blocks bots from brute-force attack (guessing the passwords) on ssh/ftp/imap/pop3/smtp):

Code: Select all

systemctl stop fail2ban.service
systemctl disable fail2ban.service
Bind or Bind9 is an open source implementation of DNS, available for almost all Linux distributions. BIND stands Berkeley Internet Name Domain & it allows us to publish DNS information on internet as well as allows us to resolve DNS queries for the users. BIND is by far the most used DNS software on Internet.
Disable Bind9 ONLY if you are using external DNS Nameservers (such as CloudFlare)

Code: Select all

systemctl stop bind9
systemctl disable bind9
Stop certain PHP-FPM version (instead of 8.2 you can insert desired version)

Code: Select all

systemctl stop php8.2-fpm
systemctl disable php8.2-fpm
User avatar
T4B
Posts: 160
Joined: Sat Jul 11, 2020 9:44 am
Been thanked: 5 times

I stopped ClamAV what commands needs to run to start it again ?
Post Reply