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


Apple Command Line tools

Few things before you start installing the below listed items on Catalina.

1. SIP needs to be disabled.

2. On unsupported macs like 2008 and 2009 2,1 and 3,1 models you need to use a patcher from dosdue1 in order to be able to install/boot into Catalina. Your best bet is if you use an SSD that is formatted APFS. Anything else will not give you the performance/speed (on these older macs) that is satisfactory.

3. Mojave and earlier os versions come with bash as the default shell. Starting with Catalina, your Mac uses zhs. You can make it a default in System Prefs under Users & Groups. https://support.apple.com/en-us/HT208050

Install command line tools via terminal and allow third party software installation:

$ xcode-select --install 
$ sudo spctl --master-disable 



Basic Brew Installation

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" 



Apache • PHP • MySql • phpMyAdmin

Install the following brew modules

$ brew install httpd php mysql phpmyadmin 
$ echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc  (restart terminal) 
$ openssl version  
pkg server_setup.pkg | July 3, 2020 - includes various edited config files and startup file for mysql.

Modify mysql to run under user "_mysql" in the background even when you're logged out from your desktop.

$ sudo -s
$ chown -R _mysql:_mysql /usr/local/var/mysql
$ brew services start httpd; brew services start php
$ launchctl load /Library/LaunchDaemons/net.captainnet.mysql.plist
$ exit

Setup MySql and create a root password. Follow instructions for secure installation.

$ mysql_secure_installation




Setup Mailadmin (ECM3)

pkg ecm3.pkg | January 15, 2020

Create database for ecm3 (login with the above created root password.

mysql -h 127.0.0.1 -u root -pPASSWORD
CREATE database ecm3; use ecm3; \. /usr/local/share/mailadmin/sql/ecm3.sql

For mailadmin (ecm3) enter your mysql root password.

$ open -e /usr/local/share/mailadmin/config/variables.php

$sqlpass = "password"; // Database password
http://localhost/mailadmin

Initial username for mailadmin is 'siteadmin' with password 'change'.




Virtual Hosts

If you're ready for virtual host setup uncomment the following line in your httpd config file.

$ open -e /usr/local/etc/httpd/httpd.conf

Include /usr/local/etc/httpd/sites/*.conf

You will also have to edit the domain config with your domain name and IP address. (/usr/local/etc/httpd/sites/example.com.conf)
Nameservers pointing to your domain will also have to be set. Stop and start apache or reboot your computer and test the following links:

$ sudo apachectl -k stop
$ sudo apachectl -k start

http://www.example.com/info.php