Skip to content

Commit 417e441

Browse files
committed
Added support for Ubuntu 18.04
Added support for Ubuntu 18.04
1 parent 2942bde commit 417e441

24 files changed

Lines changed: 731 additions & 3 deletions

CHANGELOG.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v.3.0.3
2+
- Added support for Ubuntu 18.04
3+
14
v.3.0.2
25
- Added support for nginx on Debian 9
36
- Phpmyadmin accessible on http:/IPADDRESS:8081/phpmyadmin

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The link is here: http://eepurl.com/cAzq95
88
We'll use only to inform you on new version of the script :)
99

1010
# Version #
11-
v.3.0.2
11+
v.3.0.3
1212

1313
This is a system to automate the installation of ISPConfig 3 control Panel ( http://www.ispconfig.org/page/home.html ).
1414

@@ -20,6 +20,7 @@ Tested on:
2020
- Ubuntu 14.04 Trusty ([Servisys VPS](https://www.servisys.it/), VmWare Esxi, Amazon AWS, Virtualbox, OVH VPS, Hetzner, Digital Ocean)
2121
- Ubuntu 15.10 Willy ([Servisys VPS](https://www.servisys.it/), VmWare Esxi, Amazon AWS, Virtualbox, OVH VPS, Hetzner, Digital Ocean)
2222
- Ubuntu 16.04 Xenial Xerus ( [Servisys VPS](https://www.servisys.it/), VmWare Esxi, Amazon AWS, Virtualbox, OVH VPS, Hetzner, Digital Ocean)
23+
- Ubuntu 18.04 Bionic Beaver ( [Servisys VPS](https://www.servisys.it/), VmWare Esxi, Amazon AWS, Virtualbox, OVH VPS, Hetzner, Digital Ocean)
2324
- Centos 7 ([Servisys VPS](https://www.servisys.it/), Vitualbox)
2425
- ISPConfig 3.*
2526

@@ -62,7 +63,7 @@ https://www.howtoforge.com/perfect-server-debian-wheezy-apache2-bind-dovecot-isp
6263

6364
to install debian as required for ISPConfig
6465

65-
* Configuration for Debian 7 / 8 / 9 - Ubuntu 14.04 / 15.10 / 16.04
66+
* Configuration for Debian 7 / 8 / 9 - Ubuntu 14.04 / 15.10 / 16.04 / 18.04
6667

6768
After you got a fresh and perfect Debian installation you had to
6869

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#---------------------------------------------------------------------
2+
# Function: AskQuestions Ubuntu 16.04
3+
# Ask for all needed user input
4+
#---------------------------------------------------------------------
5+
AskQuestions() {
6+
echo "Installing pre-required packages"
7+
[ -f /bin/whiptail ] && echo -e "whiptail found: ${green}OK${NC}\n" || apt-get -y install whiptail > /dev/null 2>&1
8+
9+
while [ "x$CFG_SQLSERVER" == "x" ]
10+
do
11+
CFG_SQLSERVER=$(whiptail --title "SQLSERVER" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select SQL Server type" 10 50 2 "MySQL" "(default)" ON "MariaDB" "" OFF 3>&1 1>&2 2>&3)
12+
done
13+
14+
while [ "x$CFG_MYSQL_ROOT_PWD" == "x" ]
15+
do
16+
CFG_MYSQL_ROOT_PWD=$(whiptail --title "MySQL" --backtitle "$WT_BACKTITLE" --inputbox "Please specify a root password" --nocancel 10 50 3>&1 1>&2 2>&3)
17+
done
18+
19+
while [ "x$CFG_WEBSERVER" == "x" ]
20+
do
21+
CFG_WEBSERVER=$(whiptail --title "WEBSERVER" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select webserver type" 10 50 2 "apache" "(default)" ON "nginx" "" OFF 3>&1 1>&2 2>&3)
22+
done
23+
24+
while [ "x$CFG_XCACHE" == "x" ]
25+
do
26+
CFG_XCACHE=$(whiptail --title "Install XCache" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "You want to install XCache during install? ATTENTION: If XCache is installed, Ioncube Loaders will not work !!" 20 50 2 "yes" "(default)" ON "no" "" OFF 3>&1 1>&2 2>&3)
27+
done
28+
29+
while [ "x$CFG_PHPMYADMIN" == "x" ]
30+
do
31+
CFG_PHPMYADMIN=$(whiptail --title "Install phpMyAdmin" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "You want to install phpMyAdmin during install?" 10 50 2 "yes" "(default)" ON "no" "" OFF 3>&1 1>&2 2>&3)
32+
done
33+
34+
while [ "x$CFG_MTA" == "x" ]
35+
do
36+
CFG_MTA=$(whiptail --title "Mail Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select mailserver type" 10 50 2 "dovecot" "(default)" ON "courier" "" OFF 3>&1 1>&2 2>&3)
37+
done
38+
39+
while [ "x$CFG_HHVMINSTALL" == "x" ]
40+
do
41+
CFG_HHVMINSTALL=$(whiptail --title "Install HHVM" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Do you want to install HHVM?" 10 50 2 "yes" "" OFF "no""(default)" ON 3>&1 1>&2 2>&3)
42+
done
43+
44+
while [ "x$CFG_METRONOM" == "x" ]
45+
do
46+
CFG_METRONOM=$(whiptail --title "Install Metronom XMPP Server" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Do you want to install Metronom XMPP Server?" 10 50 2 "yes" "" OFF "no""(default)" ON 3>&1 1>&2 2>&3)
47+
done
48+
49+
while [ "x$CFG_AVUPDATE" == "x" ]
50+
do
51+
CFG_AVUPDATE=$(whiptail --title "Update Freshclam DB" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "You want to update Antivirus Database during install?" 10 50 2 "yes" "(default)" ON "no" "" OFF 3>&1 1>&2 2>&3)
52+
done
53+
54+
if (whiptail --title "Quota" --backtitle "$WT_BACKTITLE" --yesno "Setup user quota?" 10 50) then
55+
CFG_QUOTA=yes
56+
else
57+
CFG_QUOTA=no
58+
fi
59+
60+
while [ "x$CFG_ISPC" == "x" ]
61+
do
62+
CFG_ISPC=$(whiptail --title "ISPConfig Setup" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Would you like full unattended setup of expert mode for ISPConfig?" 10 50 2 "standard" "(default)" ON "expert" "" OFF 3>&1 1>&2 2>&3)
63+
done
64+
65+
if (whiptail --title "Jailkit" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install Jailkit?" 10 50) then
66+
CFG_JKIT=yes
67+
else
68+
CFG_JKIT=no
69+
fi
70+
71+
CFG_WEBMAIL=squirrelmail
72+
73+
SSL_COUNTRY=$(whiptail --title "SSL Country" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Country (ex. EN)" --nocancel 10 50 3>&1 1>&2 2>&3)
74+
SSL_STATE=$(whiptail --title "SSL State" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - STATE (ex. Italy)" --nocancel 10 50 3>&1 1>&2 2>&3)
75+
SSL_LOCALITY=$(whiptail --title "SSL Locality" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Locality (ex. Udine)" --nocancel 10 50 3>&1 1>&2 2>&3)
76+
SSL_ORGANIZATION=$(whiptail --title "SSL Organization" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Organization (ex. Company L.t.d.)" --nocancel 10 50 3>&1 1>&2 2>&3)
77+
SSL_ORGUNIT=$(whiptail --title "SSL Organization Unit" --backtitle "$WT_BACKTITLE" --inputbox "SSL Configuration - Organization Unit (ex. IT Department)" --nocancel 10 50 3>&1 1>&2 2>&3)
78+
79+
}
80+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#---------------------------------------------------------------------
2+
# Function: InstallAntiVirus
3+
# Install Amavisd, Spamassassin, ClamAV
4+
#---------------------------------------------------------------------
5+
InstallAntiVirus() {
6+
echo -n "Installing Anti-Virus utilities... (This take some time. Don't abort it ...) "
7+
apt-get -yqq install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl rkhunter > /dev/null 2>&1
8+
sed -i "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/" /etc/clamav/clamd.conf
9+
echo -n "Stopping Spamassassin ... "
10+
service spamassassin stop
11+
echo -e "[${green}DONE${NC}]\n"
12+
echo -n "Disable Spamassassin ... "
13+
update-rc.d -f spamassassin remove
14+
echo -e "[${green}DONE${NC}]\n"
15+
if [ "$CFG_AVUPDATE" == "yes" ]; then
16+
echo -n "Updating ClamAV. Please Wait ... "
17+
freshclam
18+
fi
19+
echo -n "Restarting ClamAV... "
20+
service clamav-daemon restart
21+
echo -e "[${green}DONE${NC}]\n"
22+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#---------------------------------------------------------------------
2+
# Function: InstallBasePhp Debian 8
3+
# Install Basic php need to run ispconfig
4+
#---------------------------------------------------------------------
5+
InstallBasePhp(){
6+
echo -n "Installing basic php modules for ispconfig..."
7+
apt-get -yqq install php7.2-cli php7.2-mysql php7.2-mcrypt mcrypt > /dev/null 2>&1
8+
echo -e "[${green}DONE${NC}]\n"
9+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#---------------------------------------------------------------------
2+
# Function: InstallBasics
3+
# Install basic packages
4+
#---------------------------------------------------------------------
5+
InstallBasics() {
6+
echo -n "Updating apt and upgrading currently installed packages... "
7+
apt-get -qq update > /dev/null 2>&1
8+
apt-get -qqy upgrade > /dev/null 2>&1
9+
echo -e "[${green}DONE${NC}]\n"
10+
11+
echo "Installing basic packages... "
12+
apt-get -y install ssh openssh-server vim-nox php7.2-cli ntp ntpdate debconf-utils binutils sudo git lsb-release > /dev/null 2>&1
13+
service apparmor stop
14+
update-rc.d -f apparmor remove
15+
apt-get -y remove apparmor apparmor-utils
16+
17+
echo "dash dash/sh boolean false" | debconf-set-selections
18+
dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1
19+
echo -n "Reconfigure dash... "
20+
echo -e "[${green}DONE${NC}]\n"
21+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#---------------------------------------------------------------------
2+
# Function: InstallBind
3+
# Install bind DNS server
4+
#---------------------------------------------------------------------
5+
InstallBind() {
6+
echo -n "Installing Bind9... ";
7+
apt-get -y install bind9 dnsutils haveged > /dev/null 2>&1
8+
echo -e "[${green}DONE${NC}]\n"
9+
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#---------------------------------------------------------------------
2+
# Function: InstallFail2ban
3+
# Install and configure fail2ban
4+
#---------------------------------------------------------------------
5+
InstallFail2ban() {
6+
echo -n "Installing fail2ban... "
7+
apt-get -y install fail2ban > /dev/null 2>&1
8+
9+
10+
case $CFG_MTA in
11+
"courier")
12+
cat > /etc/fail2ban/jail.local <<EOF
13+
[courierpop3]
14+
enabled = true
15+
port = pop3
16+
filter = courierpop3
17+
logpath = /var/log/mail.log
18+
maxretry = 5
19+
20+
[courierpop3s]
21+
enabled = true
22+
port = pop3s
23+
filter = courierpop3s
24+
logpath = /var/log/mail.log
25+
maxretry = 5
26+
27+
[courierimap]
28+
enabled = true
29+
port = imap2
30+
filter = courierimap
31+
logpath = /var/log/mail.log
32+
maxretry = 5
33+
34+
[courierimaps]
35+
enabled = true
36+
port = imaps
37+
filter = courierimaps
38+
logpath = /var/log/mail.log
39+
maxretry = 5
40+
41+
EOF
42+
43+
cat > /etc/fail2ban/filter.d/courierpop3.conf <<EOF
44+
[Definition]
45+
failregex = pop3d: LOGIN FAILED.*ip=\[.*:<HOST>\]
46+
ignoreregex =
47+
EOF
48+
49+
cat > /etc/fail2ban/filter.d/courierpop3s.conf <<EOF
50+
[Definition]
51+
failregex = pop3d-ssl: LOGIN FAILED.*ip=\[.*:<HOST>\]
52+
ignoreregex =
53+
EOF
54+
55+
cat > /etc/fail2ban/filter.d/courierimap.conf <<EOF
56+
[Definition]
57+
failregex = imapd: LOGIN FAILED.*ip=\[.*:<HOST>\]
58+
ignoreregex =
59+
EOF
60+
61+
cat > /etc/fail2ban/filter.d/courierimaps.conf <<EOF
62+
[Definition]
63+
failregex = imapd-ssl: LOGIN FAILED.*ip=\[.*:<HOST>\]
64+
ignoreregex =
65+
EOF
66+
;;
67+
"dovecot")
68+
cat > /etc/fail2ban/jail.local <<EOF
69+
70+
[dovecot-pop3imap]
71+
enabled = true
72+
filter = dovecot-pop3imap
73+
action = iptables-multiport[name=dovecot-pop3imap, port="pop3,pop3s,imap,imaps", protocol=tcp]
74+
logpath = /var/log/mail.log
75+
maxretry = 5
76+
EOF
77+
78+
cat > /etc/fail2ban/filter.d/dovecot-pop3imap.conf <<EOF
79+
[Definition]
80+
failregex = (?: pop3-login|imap-login): .*(?:Authentication failure|Aborted login \(auth failed|Aborted login \(tried to use disabled|Disconnected \(auth failed|Aborted login \(\d+ authentication attempts).*rip=(?P<host>\S*),.*
81+
ignoreregex =
82+
EOF
83+
;;
84+
esac
85+
86+
cat >> /etc/fail2ban/jail.local <<EOF
87+
[pureftpd]
88+
enabled = true
89+
port = ftp
90+
filter = pureftpd
91+
logpath = /var/log/syslog
92+
maxretry = 3
93+
94+
[postfix-sasl]
95+
enabled = true
96+
port = smtp
97+
filter = postfix-sasl
98+
logpath = /var/log/mail.log
99+
maxretry = 5
100+
101+
EOF
102+
103+
cat > /etc/fail2ban/filter.d/pureftpd.conf <<EOF
104+
[Definition]
105+
failregex = .*pure-ftpd: \(.*@<HOST>\) \[WARNING\] Authentication failed for user.*
106+
ignoreregex =
107+
EOF
108+
109+
echo "ignoreregex =" >> /etc/fail2ban/filter.d/postfix-sasl.conf
110+
111+
service fail2ban restart > /dev/null 2>&1
112+
echo -e "[${green}DONE${NC}]\n"
113+
}
114+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
InstallFix(){
2+
if [ "$CFG_DKIM" == "n" ]; then
3+
mkdir -p /var/db/dkim/
4+
amavisd-new genrsa /var/db/dkim/$CFG_HOSTNAME_FQDN.key.pem
5+
sed -i 's/$enable_dkim_verification = 0; #disabled to prevent warning/#$enable_dkim_verification = 0; #disabled to prevent warning/' /etc/amavis/conf.d/20-debian_defaults
6+
echo "\$enable_dkim_verification = 1;" >> /etc/amavis/conf.d/20-debian_defaults
7+
echo "\$enable_dkim_signing = 1;" >> /etc/amavis/conf.d/20-debian_defaults
8+
echo "dkim_key('$CFG_HOSTNAME_FQDN', 'dkim', '/var/db/dkim/$CFG_HOSTNAME_FQDN.key.pem');" >> /etc/amavis/conf.d/20-debian_defaults
9+
echo "@dkim_signature_options_bysender_maps = ({ '.' => { ttl => 21*24*3600, c => 'relaxed/simple' } } );" >> /etc/amavis/conf.d/20-debian_defaults
10+
MYNET=`cat /etc/postfix/main.cf | grep "mynetworks =" | sed 's/mynetworks = //'`
11+
echo "@mynetworks = qw( $MYNET );" >> /etc/amavis/conf.d/20-debian_defaults
12+
if [ -f /etc/init.d/amavisd-new ]; then
13+
service amavisd-new restart > /dev/null 2>&1
14+
else
15+
service amavis restart > /dev/null 2>&1
16+
fi
17+
fi
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#---------------------------------------------------------------------
2+
# Function: InstallFTP
3+
# Install and configure PureFTPd
4+
#---------------------------------------------------------------------
5+
InstallFTP() {
6+
echo -n "Installing PureFTPd... "
7+
echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections
8+
apt-get -yqq install pure-ftpd-common pure-ftpd-mysql > /dev/null 2>&1
9+
sed -i 's/ftp/\#ftp/' /etc/inetd.conf
10+
echo 1 > /etc/pure-ftpd/conf/TLS
11+
mkdir -p /etc/ssl/private/
12+
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem -subj "/C=$SSL_COUNTRY/ST=$SSL_STATE/L=$SSL_LOCALITY/O=$SSL_ORGANIZATION/OU=$SSL_ORGUNIT/CN=$CFG_HOSTNAME_FQDN"
13+
chmod 600 /etc/ssl/private/pure-ftpd.pem
14+
service openbsd-inetd restart > /dev/null 2>&1
15+
service pure-ftpd-mysql restart > /dev/null 2>&1
16+
echo -e "[${green}DONE${NC}]\n"
17+
}
18+

0 commit comments

Comments
 (0)