Today I’m going to discuss about installing ISPConfig 3 on Ubuntu 20.04 and the little issues I came across when installing it.
So, let’s get to it:
- Download Ubuntu 20.04 ISO: https://releases.ubuntu.com/20.04/ubuntu-20.04.4-live-server-amd64.iso
- Install Ubuntu and configure your network card properly (see: /etc/netplan/00-installer-config.yaml and netplan apply if you changed anything)
- Configure your hostname and hosts
nano /etc/hosts
1 2 3 4 5 6 7 8 |
127.0.0.1 localhost.localdomain localhost # This line should be changed to the correct servername: 127.0.1.1 mail1.pbnet.local mail1 # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters |
- Configure the hostname
nano /etc/hostname
and ensure that only the subdomain part is present: e.g. mail1
- Reboot the system: systemctl reboot
- Verify the correct hostname and FQDN
hostname ——> should display mail1
hostname -f —–> should display mail1.pbnet.local
- update your system: apt-get update && apt-get upgrade
- eventually apt-get dist-upgrade
- do the clean-up: apt-get autoremove and apt-get autoclean
- Run ISPCONFIG‘s auto installer:
1 |
wget -O - https://get.ispconfig.org | sh -s -- --help |
- after all the pre-requisites are installed, you can run the script with arguments: e.g. with a port range for passive FTP and unattended upgrades
1 |
wget -O - https://get.ispconfig.org | sh -s -- <code>--use-ftp-ports=40110-40210</code> --unattended-upgrades |
- follow the on-screen instructions and at the end don’t forget to copy your ISPConfig Admin and MySQL Root password:
1 2 |
[INFO] Your ISPConfig admin password is: 5GvfSSSYsdfdYC [INFO] Your MySQL root password is: kkAkft82d!kafMwqxdtYs |
Now with the things that I encountered, like Amavisd not running properly, I decided to switch to Rspamd
- Install Redis
1 |
apt-get install redis-server lsb-release |
- Install Unbound if BIND is not installed
1 |
which named |
if the command returns the path to the named binary:
1 2 |
root@server1:/tmp# which named /usr/sbin/named |
then BIND and installed. Otherwise just run: apt-get install unbound
- Install and configure Rspamd
1 2 3 4 |
CODENAME=`lsb_release -c -s` wget -O- https://rspamd.com/apt-stable/gpg.key | apt-key add - echo "deb [arch=amd64] http://rspamd.com/apt-stable/ $CODENAME main" > /etc/apt/sources.list.d/rspamd.list echo "deb-src [arch=amd64] http://rspamd.com/apt-stable/ $CODENAME main" >> /etc/apt/sources.list.d/rspamd.list |
- update the package list
1 |
apt-get update |
- Install Rspamd with apt-get:
1 |
apt-get install rspamd |
- Activate Redis and Rspamd:
1 |
echo 'servers = "127.0.0.1";' > /etc/rspamd/local.d/redis.conf |
- Increase the Rspamd hstory, enable compression and show the subject in history (optional)
1 2 3 |
echo "nrows = 2500;" > /etc/rspamd/local.d/history_redis.conf echo "compress = true;" >> /etc/rspamd/local.d/history_redis.conf echo "subject_privacy = false;" >> /etc/rspamd/local.d/history_redis.conf |
- Restart Rspamd
1 |
systemctl restart rspamd |
- Update ISPConfig: ISPConfig needs to be updated to enable the Rspamd configuration. When the updater ask you if you want to reconfigure services, choose yes
1 2 3 4 5 |
cd /tmp wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz tar xvfz ISPConfig-3-stable.tar.gz cd ispconfig3_install/install php -q update.php |
- Enable Rspamd in ISPConfig
Login as the admin user
Go to: System –> Server Config –> Mail and from the content filter switch from Amavisd to Rspamd
More info: Replacing Amavisd with Rspamd in ISPConfig 3.1 on Debian and Ubuntu (howtoforge.com)
- Disable Amavisd
1 2 |
systemctl stop amavisd-new systemctl disable amavisd-new |
Another issue: you lost the MySQL root password:
- sudo service mysql stop
- sudo mysqld_safe –skip-grant-tables
- sudo service mysql start
- sudo mysql -u root
- use mysql;
- show tables;
- describe user;
- update user set authentication_string=password(‘1111′) where user=’root’;
- FLUSH PRIVILEGES;
Log in with password “1111”.
Another issue: you lost the admin password for ISPConfig3
- Log in to the MySQL database
1 |
mysql -u root -p |
- Enter the password of the mySQL root user. To switch to the ISPConfig database, run this command:
1 |
use dbispconfig; |
- execute this command:
1 |
UPDATE sys_user SET passwort = md5('admin') WHERE username = 'admin'; |
- Finally close MySQL shell:
1 |
quit; |