ECM3 email, web, ftp and
dns server installation on macOS Catalina

Page 1 - Brew, Apache, Mysql, phpMyAdmin
Page 2 - Exim, Dovecot, Spamassassin, Clamav, Roundcube
Page 3 - PowerDNS Recursor and Authoritative Server
Page 4 - Nginx (optional)
Page 5 - PureFTPd and Webalizer (optional)
Page 6 - SSL Certificates using Let'sEncrypt
Upgrades - How to upgrade brew modules


How to update/upgrade various brew modules

Upgrading apache, php, phpmyadmin:

$ brew update
$ brew upgrade httpd
$ brew upgrade php
$ brew upgrade phpmyadmin
$ brew upgrade certbot

Restart php and apache and nginx (if you installed it).

$ sudo -s
$ launchctl unload /Library/LaunchDaemons/homebrew.mxcl.php.plist; sleep 1; \
  launchctl load /Library/LaunchDaemons/homebrew.mxcl.php.plist
$ nginx -s reload; apachectl -k restart


Upgrading mysql:

$ brew upgrade mysql
$ sudo -s
$ chown -R _mysql:_mysql /usr/local/var/mysql
$ sudo -s
$ ln -s /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/opt/mysql/lib
$ ln -s /usr/local/opt/openssl/lib/libssl.dylib /usr/local/opt/mysql/lib

$ launchctl unload /Library/LaunchDaemons/net.captainnet.mysql.plist; sleep 1; \
  launchctl load /Library/LaunchDaemons/net.captainnet.mysql.plist


Upgrading clamav:

$ brew upgrade clamav
$ sudo -s
$ chown clamav:admin /usr/local/opt/clamav/share/clamav
$ /usr/local/opt/clamav/bin/freshclam -v

pkg clamav-start.pkg | May 7, 2020
Restart clamd and freshclam. (copy each group as one line after you log in with sudo -s)

$ sudo -s
launchctl unload /Library/LaunchDaemons/net.captainnet.clamd.plist; sleep 3; \
launchctl load /Library/LaunchDaemons/net.captainnet.clamd.plist

$ sudo -s
launchctl unload /Library/LaunchDaemons/net.captainnet.freshclam.plist; sleep 3; \
launchctl load /Library/LaunchDaemons/net.captainnet.freshclam.plist


Upgrading nginx (if installed):

$ brew upgrade nginx
$ sudo nginx -s reload