├── .gitattributes ├── .gitignore ├── .travis.yml ├── CHANGELOG.txt ├── LICENSE ├── README.md ├── TO-DO.md ├── contributors.txt ├── distros ├── centos7 │ ├── askquestions.sh │ ├── install_antivirus.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_ispconfig.sh │ ├── install_jailkit.sh │ ├── install_mailman.sh │ ├── install_metronome.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ └── preinstallcheck.sh ├── debian10 │ ├── askquestions.sh │ ├── askquestions_multiserver.sh │ ├── install_antivirus.sh │ ├── install_basephp.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_hhvm.sh │ ├── install_ispconfig.sh │ ├── install_ispconfigbeta.sh │ ├── install_jailkit.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_phpmyadmin.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ ├── phpmyadmin_nginx.sh │ └── preinstallcheck.sh ├── debian11 │ ├── askquestions.sh │ ├── askquestions_multiserver.sh │ ├── install_antivirus.sh │ ├── install_basephp.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_hhvm.sh │ ├── install_ispconfig.sh │ ├── install_ispconfigbeta.sh │ ├── install_jailkit.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_phpmyadmin.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ ├── phpmyadmin_nginx.sh │ └── preinstallcheck.sh ├── debian7 │ ├── askquestions.sh │ ├── install_antivirus.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_ispconfig.sh │ ├── install_jailkit.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ └── preinstallcheck.sh ├── debian8 │ ├── askquestions.sh │ ├── askquestions_multiserver.sh │ ├── install_antivirus.sh │ ├── install_basephp.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_hhvm.sh │ ├── install_ispconfig.sh │ ├── install_ispconfigbeta.sh │ ├── install_jailkit.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ └── preinstallcheck.sh ├── debian9 │ ├── askquestions.sh │ ├── askquestions_multiserver.sh │ ├── install_antivirus.sh │ ├── install_basephp.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_hhvm.sh │ ├── install_ispconfig.sh │ ├── install_ispconfigbeta.sh │ ├── install_jailkit.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ └── preinstallcheck.sh ├── ubuntu-14.04 │ ├── askquestions.sh │ ├── install_antivirus.sh │ ├── install_basephp.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_hhvm.sh │ ├── install_ispconfig.sh │ ├── install_jailkit.sh │ ├── install_metronome.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ └── preinstallcheck.sh ├── ubuntu-15.10 │ ├── Install_metronome.sh │ ├── askquestions.sh │ ├── install_antivirus.sh │ ├── install_basephp.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_hhvm.sh │ ├── install_ispconfig.sh │ ├── install_jailkit.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ └── preinstallcheck.sh ├── ubuntu-16.04 │ ├── askquestions.sh │ ├── install_antivirus.sh │ ├── install_basephp.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_hhvm.sh │ ├── install_ispconfig.sh │ ├── install_jailkit.sh │ ├── install_metronome.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ └── preinstallcheck.sh ├── ubuntu-16.10 │ ├── askquestions.sh │ ├── install_antivirus.sh │ ├── install_basephp.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_hhvm.sh │ ├── install_ispconfig.sh │ ├── install_jailkit.sh │ ├── install_metronome.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ └── preinstallcheck.sh └── ubuntu-18.04 │ ├── askquestions.sh │ ├── install_antivirus.sh │ ├── install_basephp.sh │ ├── install_basics.sh │ ├── install_bind.sh │ ├── install_fail2ban.sh │ ├── install_fix.sh │ ├── install_ftp.sh │ ├── install_hhvm.sh │ ├── install_ispconfig.sh │ ├── install_jailkit.sh │ ├── install_metronome.sh │ ├── install_mta.sh │ ├── install_mysql.sh │ ├── install_postfix.sh │ ├── install_quota.sh │ ├── install_webmail.sh │ ├── install_webserver.sh │ ├── install_webstats.sh │ └── preinstallcheck.sh ├── font └── straight.flf ├── functions └── check_linux.sh └── install.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text eol=lf 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | +.DS_Store 2 | *.swp 3 | Thumbs.db -------------------------------------------------------------------------------- /TO-DO.md: -------------------------------------------------------------------------------- 1 | My to-do list for the ispconfig3 installer script. 2 | 3 | Must have:
4 | - [x] Fix the script(would be nice hehe)! 5 | - [x] Check if the slave-server can connect to the master servers database before installing. 6 | - [ ] Documentation on the cluster setup with this script... 7 |
Nice to Have: 8 | - [ ] Add Users too mysql-datbase host via sh or pHp script 9 | - [ ] Add/include the feature to install skin on ispconfig3 10 | - [ ] Add roundcube with skin to the installer... 11 |
Maybe some day: 12 | - [ ] World domination? 13 | 14 | 15 | Suggestions? feel free to comment. 16 | -------------------------------------------------------------------------------- /contributors.txt: -------------------------------------------------------------------------------- 1 | Matteo Temporini 2 | Agdod and Johuotar adding debain10 support 3 | -------------------------------------------------------------------------------- /distros/centos7/install_antivirus.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallAntiVirus 3 | # Install Amavisd, Spamassassin, ClamAV 4 | #--------------------------------------------------------------------- 5 | InstallAntiVirus() { 6 | echo -n "Installing Antivirus utilities (Amavisd-new, ClamAV), Spam filtering (SpamAssassin) and Greylisting (Postgrey)... " 7 | # yum_install amavisd-new spamassassin clamav clamav-server clamav-server-systemd clamav-data-empty clamav-update clamav-unofficial-sigs postgrey unzip bzip2 unrar perl-DBD-mysql 8 | yum_install amavisd-new spamassassin clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd unzip bzip2 perl-DBD-mysql postgrey re2c 9 | sed -i "s/Example/#Example/" /etc/freshclam.conf 10 | sa-update 11 | echo -e "[${green}DONE${NC}]\n" 12 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 13 | freshclam 14 | systemctl enable amavisd.service 15 | systemctl start amavisd.service 16 | systemctl start clamd@amavisd.service 17 | systemctl enable postgrey.service 18 | systemctl start postgrey.service 19 | echo -e "[${green}DONE${NC}]\n" 20 | } 21 | -------------------------------------------------------------------------------- /distros/centos7/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo -n "Updating yum package database and upgrading currently installed packages... " 7 | hide_output yum -y update 8 | echo -e "[${green}DONE${NC}]\n" 9 | 10 | echo -n "Installing basic packages... " 11 | yum_install nano wget net-tools NetworkManager-tui selinux-policy deltarpm epel-release yum-priorities which 12 | rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY* 13 | sed -i "/mirrorlist=/ a priority=10" /etc/yum.repos.d/epel.repo 14 | echo -e "[${green}DONE${NC}]\n" 15 | 16 | echo -n "Disabling Firewall... " 17 | systemctl stop firewalld.service 18 | systemctl disable firewalld.service 19 | echo -e "[${green}DONE${NC}]\n" 20 | 21 | echo -n "Disabling SELinux... " 22 | sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config 23 | echo -e "[${green}DONE${NC}]\n" 24 | 25 | echo -n "Installing Development Tools... " 26 | hide_output yum -y groupinstall 'Development Tools' 27 | echo -e "[${green}DONE${NC}]\n" 28 | } 29 | 30 | -------------------------------------------------------------------------------- /distros/centos7/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | yum_install bind bind-utils haveged 8 | cp /etc/named.conf /etc/named.conf_bak 9 | echo "options {" > /etc/named.conf 10 | echo " listen-on port 53 { any; };" >> /etc/named.conf 11 | echo " listen-on-v6 port 53 { any; };" >> /etc/named.conf 12 | echo " directory \"/var/named\";" >> /etc/named.conf 13 | echo " dump-file \"/var/named/data/cache_dump.db\";" >> /etc/named.conf 14 | echo " statistics-file \"/var/named/data/named_stats.txt\";" >> /etc/named.conf 15 | echo " memstatistics-file \"/var/named/data/named_mem_stats.txt\";" >> /etc/named.conf 16 | echo " allow-query { any; };" >> /etc/named.conf 17 | echo " allow-recursion {\"none\";};" >> /etc/named.conf 18 | echo " recursion no;" >> /etc/named.conf 19 | echo "};" >> /etc/named.conf 20 | echo "logging {" >> /etc/named.conf 21 | echo " channel default_debug {" >> /etc/named.conf 22 | echo " file \"data/named.run\";" >> /etc/named.conf 23 | echo " severity dynamic;" >> /etc/named.conf 24 | echo " };" >> /etc/named.conf 25 | echo "};" >> /etc/named.conf 26 | echo "zone \".\" IN {" >> /etc/named.conf 27 | echo " type hint;" >> /etc/named.conf 28 | echo " file \"named.ca\";" >> /etc/named.conf 29 | echo "};" >> /etc/named.conf 30 | echo "include \"/etc/named.conf.local\";" >> /etc/named.conf 31 | touch /etc/named.conf.local 32 | systemctl enable named.service 33 | systemctl start named.service 34 | systemctl enable haveged.service 35 | systemctl start haveged.service 36 | 37 | echo -e "[${green}DONE${NC}]\n" 38 | } 39 | -------------------------------------------------------------------------------- /distros/centos7/install_fail2ban.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFail2ban 3 | # Install and configure fail2ban 4 | #--------------------------------------------------------------------- 5 | InstallFail2ban() { 6 | echo -n "Installing Intrusion protection (Fail2Ban) and Rootkit detection (rkhunter)... " 7 | yum_install iptables-services fail2ban fail2ban-systemd rkhunter 8 | 9 | systemctl stop firewalld.service 10 | systemctl mask firewalld.service 11 | systemctl disable firewalld.service 12 | systemctl stop firewalld.service 13 | systemctl enable fail2ban.service 14 | systemctl start fail2ban.service 15 | 16 | echo -e "[${green}DONE${NC}]\n" 17 | } 18 | 19 | -------------------------------------------------------------------------------- /distros/centos7/install_fix.sh: -------------------------------------------------------------------------------- 1 | InstallFix(){ 2 | if [ "$CFG_WEBMAIL" == "roundcube" ]; then 3 | echo "Installing Roundcube fix... " 4 | cd /tmp 5 | git clone https://github.com/w2c/ispconfig3_roundcube.git 6 | cd /tmp/ispconfig3_roundcube/ 7 | mv ispconfig3_* /var/lib/roundcube/plugins 8 | cd /var/lib/roundcube/plugins 9 | mv ispconfig3_account/config/config.inc.php.dist ispconfig3_account/config/config.inc.php 10 | read -p "If you heaven't done yet add roundcube remtoe user in ISPConfig, with the following permission: Server functions - Client functions - Mail user functions - Mail alias functions - Mail spamfilter user functions - Mail spamfilter policy functions - Mail fetchmail functions - Mail spamfilter whitelist functions - Mail spamfilter blacklist functions - Mail user filter functions" 11 | sed -i "s/\$rcmail_config\['plugins'\] = array();/\$rcmail_config\['plugins'\] = array(\"jqueryui\", \"ispconfig3_account\", \"ispconfig3_autoreply\", \"ispconfig3_pass\", \"ispconfig3_spam\", \"ispconfig3_fetchmail\", \"ispconfig3_filter\");/" /etc/roundcube/main.inc.php 12 | sed -i "s/\$rcmail_config\['skin'\] = 'default';/\$rcmail_config\['skin'\] = 'classic';/" /etc/roundcube/main.inc.php 13 | #nano /var/lib/roundcube/plugins/ispconfig3_account/config/config.inc.php # <---- This should not be a Part of Installer. Every Admi can add this after Installation 14 | echo -e "[${green}DONE${NC}]\n" 15 | fi 16 | if [ $CFG_DKIM == "n" ]; then 17 | mkdir -p /var/db/dkim/ 18 | amavisd-new genrsa /var/db/dkim/$CFG_HOSTNAME_FQDN.key.pem 19 | 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 20 | echo "\$enable_dkim_verification = 1;" >> /etc/amavis/conf.d/20-debian_defaults 21 | echo "\$enable_dkim_signing = 1;" >> /etc/amavis/conf.d/20-debian_defaults 22 | echo "dkim_key('$CFG_HOSTNAME_FQDN', 'dkim', '/var/db/dkim/$CFG_HOSTNAME_FQDN.key.pem');" >> /etc/amavis/conf.d/20-debian_defaults 23 | echo "@dkim_signature_options_bysender_maps = ({ '.' => { ttl => 21*24*3600, c => 'relaxed/simple' } } );" >> /etc/amavis/conf.d/20-debian_defaults 24 | MYNET=$(grep "mynetworks =" cat /etc/postfix/main.cf | sed 's/mynetworks = //') 25 | echo "@mynetworks = qw( $MYNET );" >> /etc/amavis/conf.d/20-debian_defaults 26 | if [ -f /etc/init.d/amavisd-new ]; then 27 | echo -n "Restarting Amavisd-new... " 28 | service amavisd-new restart 29 | else 30 | echo -n "Restarting Amavisd... " 31 | service amavis restart 32 | fi 33 | echo -e "[${green}DONE${NC}]\n" 34 | fi 35 | } 36 | -------------------------------------------------------------------------------- /distros/centos7/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | yum_install pure-ftpd 8 | systemctl enable pure-ftpd.service 9 | systemctl start pure-ftpd.service 10 | yum_install openssl 11 | sed -i 's/# TLS 1/TLS 1/' /etc/pure-ftpd/pure-ftpd.conf 12 | 13 | mkdir -p /etc/ssl/private/ 14 | 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" 15 | chmod 600 /etc/ssl/private/pure-ftpd.pem 16 | systemctl restart pure-ftpd.service 17 | echo -e "[${green}DONE${NC}]\n" 18 | } 19 | 20 | -------------------------------------------------------------------------------- /distros/centos7/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.19" #Jailkit Version -> Maybe this can be automated 8 | SUM="f46cac122ac23b1825330d588407aa96" 9 | 10 | InstallJailkit() { 11 | # If the jailkit RPM is NOT installed, build from source 12 | if [ "$(rpm -q --quiet jailkit)" ]; then 13 | echo -n "Installing Jailkit... " 14 | cd /tmp 15 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 16 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 17 | echo -e "$\n{red}Error: md5sum does not match${NC}" >&2 18 | echo "Please try running this script again" >&2 19 | exit 1 20 | fi 21 | tar xzf jailkit-$JKV.tar.gz 22 | cd jailkit-$JKV 23 | ./configure 24 | make 25 | make install 26 | cd .. 27 | rm -rf jailkit-$JKV 28 | echo -e "[${green}DONE${NC}]\n" 29 | fi 30 | } 31 | 32 | -------------------------------------------------------------------------------- /distros/centos7/install_mailman.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMailman 3 | # Install the Mailman list manager 4 | #--------------------------------------------------------------------- 5 | InstallMailman() { 6 | echo -n "Installing Mailman... "; 7 | yum_install mailman 8 | /usr/lib/mailman/bin/mmsitepass "${MMSITEPASS}" 9 | /usr/lib/mailman/bin/newlist -q mailman "${MMLISTOWNER}" "${MMLISTPASS}" | grep '/usr/lib' >> /etc/mailman/aliases 10 | postalias /etc/mailman/aliases 11 | # Get mailman in the path so that the ISPConfig installer detects it 12 | ln -s /usr/lib/mailman/mail/mailman /usr/bin/mailman 13 | systemctl restart postfix.service 14 | systemctl enable mailman.service 15 | systemctl start mailman.service 16 | echo -e "[${green}DONE${NC}]\n" 17 | } 18 | -------------------------------------------------------------------------------- /distros/centos7/install_metronome.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMetronome 3 | # Install metronomeServer 4 | #--------------------------------------------------------------------- 5 | InstallMetronome() { 6 | echo -n "Installing Metronome... "; 7 | yum_install git lua lua-devel lua-filesystem libidn-devel openssl-devel lua-bitop lua-socket lua-sec luarocks 8 | luarocks install lpc 9 | adduser --no-create-home --shell /sbin/nologin --comment 'Metronome' metronome 10 | cd /opt; git clone https://github.com/maranda/metronome.git metronome 11 | cd ./metronome; ./configure --ostype=centos --prefix=/usr 12 | make 13 | make install 14 | pushd /etc/metronome/certs && make localhost.key && make localhost.csr && make localhost.cert && chmod 0400 localhost.key && chown metronome localhost.key 15 | popd 16 | /bin/rm -rf metronome 17 | echo -e "[${green}DONE${NC}]\n" 18 | } 19 | -------------------------------------------------------------------------------- /distros/centos7/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | case $CFG_MTA in 7 | "courier") 8 | echo -n "Installing POP3/IMAP Mail server (Courier)... "; 9 | echo -e "\n${red}Sorry but Courier is not yet supported.${NC}" >&2 10 | echo -e "For more information, see this issue: https://github.com/servisys/ispconfig_setup/issues/70\n" 11 | echo "Press ENTER" 12 | read DUMMY 13 | ;; 14 | "dovecot") 15 | echo -n "Installing POP3/IMAP Mail server (Dovecot)... "; 16 | yum_install dovecot dovecot-mysql dovecot-pigeonhole 17 | touch /etc/dovecot/dovecot-sql.conf 18 | ln -s /etc/dovecot/dovecot-sql.conf /etc/dovecot-sql.conf 19 | systemctl enable dovecot 20 | systemctl start dovecot 21 | echo -e "[${green}DONE${NC}]\n" 22 | ;; 23 | esac 24 | } 25 | -------------------------------------------------------------------------------- /distros/centos7/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMysql 3 | # Install and configure mysql 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | echo -n "Installing Database server (MariaDB)... " 7 | yum_install mariadb-server expect 8 | systemctl enable mariadb.service 9 | systemctl start mariadb.service 10 | SECURE_MYSQL=$(expect -c " 11 | set timeout 3 12 | spawn mysql_secure_installation 13 | expect \"Enter current password for root (enter for none):\" 14 | send \"\r\" 15 | expect \"root password?\" 16 | send \"y\r\" 17 | expect \"New password:\" 18 | send \"$CFG_MYSQL_ROOT_PWD\r\" 19 | expect \"Re-enter new password:\" 20 | send \"$CFG_MYSQL_ROOT_PWD\r\" 21 | expect \"Remove anonymous users?\" 22 | send \"y\r\" 23 | expect \"Disallow root login remotely?\" 24 | send \"y\r\" 25 | expect \"Remove test database and access to it?\" 26 | send \"y\r\" 27 | expect \"Reload privilege tables now?\" 28 | send \"y\r\" 29 | expect eof 30 | ") 31 | echo "${SECURE_MYSQL}" 32 | echo -e "[${green}DONE${NC}]\n" 33 | } 34 | -------------------------------------------------------------------------------- /distros/centos7/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | echo -n "Disabling Sendmail... " 7 | systemctl stop sendmail.service 8 | systemctl disable sendmail.service 9 | echo -e "[${green}DONE${NC}]\n" 10 | echo -n "Installing SMTP Mail server (Postfix)... " 11 | yum_install postfix ntp getmail 12 | #Fix for mailman virtualtable - need also without mailman 13 | mkdir /etc/mailman/ 14 | touch /etc/mailman/virtual-mailman 15 | postmap /etc/mailman/virtual-mailman 16 | systemctl enable postfix.service 17 | systemctl restart postfix.service 18 | echo -e "[${green}DONE${NC}]\n" 19 | } 20 | -------------------------------------------------------------------------------- /distros/centos7/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | echo -e "\n${red}Sorry but Quota is not yet supported.${NC}" >&2 8 | echo -e "For more information, see this issue: https://github.com/servisys/ispconfig_setup/issues/69\n" 9 | return 10 | yum_install quota 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | if ! [ -f /proc/user_beancounters ]; then 14 | echo -n "Initializing Quota, this may take awhile... " 15 | if [ "$(grep -c ',uquota,gquota' /etc/fstab)" -eq 0 ]; then 16 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,uquota,gquota/}' /etc/fstab 17 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,uquota,gquota/}' /etc/fstab 18 | fi 19 | mount -o remount / 20 | quotacheck -avugm 21 | quotaon -avug 22 | echo -e "[${green}DONE${NC}]\n" 23 | fi 24 | } 25 | -------------------------------------------------------------------------------- /distros/centos7/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Webalizer and AWStats)... "; 7 | yum_install webalizer awstats perl-DateTime-Format-HTTP perl-DateTime-Format-Builder 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | 11 | -------------------------------------------------------------------------------- /distros/centos7/preinstallcheck.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: PreInstallCheck 3 | # Do some pre-install checks 4 | #--------------------------------------------------------------------- 5 | PreInstallCheck() { 6 | echo -n "Preparing to install... " 7 | # Check if the FQDN is in /etc/hosts 8 | if [ "X$(grep -E "[a-z,A-Z,0-9\.\-]{2,}" /etc/hostname |grep -vi "localhost")" == "X" ] ; then 9 | echo -e "\n${red}Before installing ISPConfig, please read the Preliminary Note at: https://www.howtoforge.com/tutorial/centos-7-server/${NC}" 10 | exit 1 11 | fi 12 | 13 | if [ "$(getsebool 2>&1)" != "getsebool: SELinux is disabled" ]; then 14 | sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config 15 | sed -i "s/SELINUX=permissive/SELINUX=disabled/" /etc/selinux/config 16 | 17 | echo -e "\n${red}Attention your SELINUX was enabled, we had modified your configuration.${NC}" 18 | echo -e "${red}Before restart ISPConfig setup please reboot the server.${NC}" 19 | echo -e "${red}The script will exit to let you reboot the server${NC}" 20 | echo "Press Enter to exit" 21 | read DUMMY 22 | exit 1 23 | fi 24 | 25 | 26 | while [[ ! "$CFG_NETWORK" =~ $RE ]] 27 | do 28 | CFG_NETWORK=$(whiptail --title "Network" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Have you already configured the Network? If not, we will invoke network configuration tool for you" 10 50 2 "yes" "(default)" ON "no" "" OFF 3>&1 1>&2 2>&3) 29 | done 30 | 31 | if [ "$CFG_NETWORK" == "no" ]; then 32 | nmtui 33 | fi 34 | 35 | echo -e "[${green}DONE${NC}]\n" 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /distros/debian10/install_antivirus.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallAntiVirus 3 | # Install Amavisd, Spamassassin, ClamAV 4 | #--------------------------------------------------------------------- 5 | InstallAntiVirus() { 6 | echo -n "Installing Antivirus utilities (Amavisd-new, ClamAV), Spam filtering (SpamAssassin), Greylisting (Postgrey) and Rootkit detection (rkhunter)... (This may take awhile. Do not abort it...) " 7 | apt_install amavisd-new spamassassin clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full unrar lrzip 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 libdbd-mysql-perl postgrey unrar-free unp lz4 liblz4-tool unp 8 | sed -i "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/" /etc/clamav/clamd.conf 9 | echo "use strict;" > /etc/amavis/conf.d/05-node_id 10 | echo "chomp(\$myhostname = \`hostname --fqdn\`);" >> /etc/amavis/conf.d/05-node_id 11 | echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id 12 | echo "1;" >> /etc/amavis/conf.d/05-node_id 13 | echo "$CFG_HOSTNAME_FQDN" > /etc/mailname 14 | echo -e "[${green}DONE${NC}]\n" 15 | echo -n "Stopping SpamAssassin... " 16 | systemctl stop spamassassin 17 | echo -e "[${green}DONE${NC}]\n" 18 | echo -n "Disabling SpamAssassin... " 19 | hide_output systemctl disable spamassassin 20 | echo -e "[${green}DONE${NC}]\n" 21 | if [ "$CFG_AVUPDATE" == "yes" ]; then 22 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 23 | freshclam 24 | echo -e "[${green}DONE${NC}]\n" 25 | fi 26 | echo -n "Restarting ClamAV... " 27 | systemctl restart clamav-daemon 28 | echo -e "[${green}DONE${NC}]\n" 29 | } 30 | -------------------------------------------------------------------------------- /distros/debian10/install_basephp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasePhp Debian 10 3 | # Install Basic php need to run ispconfig 4 | #--------------------------------------------------------------------- 5 | InstallBasePhp(){ 6 | echo -n "Installing basic PHP modules... " 7 | apt_install php-cli php-mysql php-mcrypt mcrypt php-mbstring 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/debian10/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo -n "Updating apt package database and upgrading currently installed packages... " 7 | hide_output apt-get update 8 | # hide_output apt-get -y upgrade 9 | hide_output apt-get -y dist-upgrade 10 | hide_output apt-get -y autoremove 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | echo -n "Installing basic packages (OpenSSH server, NTP, binutils, etc.)... " 14 | apt_install ssh openssh-server nano vim-nox ntp debconf-utils binutils sudo git lsb-release e2fsprogs 15 | echo -e "[${green}DONE${NC}]\n" 16 | 17 | if [ /bin/sh -ef /bin/dash ]; then 18 | echo -n "Changing the default shell from dash to bash... " 19 | echo "dash dash/sh boolean false" | debconf-set-selections 20 | dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 21 | echo -e "[${green}DONE${NC}]\n" 22 | fi 23 | } 24 | -------------------------------------------------------------------------------- /distros/debian10/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | apt_install bind9 dnsutils 8 | echo -e "[${green}DONE${NC}]\n" 9 | echo -n "Installing haveged... "; 10 | apt_install haveged 11 | echo -e "[${green}DONE${NC}]\n" 12 | } 13 | -------------------------------------------------------------------------------- /distros/debian10/install_fail2ban.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFail2ban 3 | # Install and configure fail2ban 4 | #--------------------------------------------------------------------- 5 | InstallFail2ban() { 6 | echo -n "Installing Intrusion protection (Fail2Ban)... " 7 | apt_install fail2ban 8 | 9 | 10 | case $CFG_MTA in 11 | "courier") 12 | cat > /etc/fail2ban/jail.local < /etc/fail2ban/filter.d/courierpop3.conf <\] 46 | ignoreregex = 47 | EOF 48 | 49 | cat > /etc/fail2ban/filter.d/courierpop3s.conf <\] 52 | ignoreregex = 53 | EOF 54 | 55 | cat > /etc/fail2ban/filter.d/courierimap.conf <\] 58 | ignoreregex = 59 | EOF 60 | 61 | cat > /etc/fail2ban/filter.d/courierimaps.conf <\] 64 | ignoreregex = 65 | EOF 66 | ;; 67 | "dovecot") 68 | cat > /etc/fail2ban/jail.local <> /etc/fail2ban/jail.local <> /etc/amavis/conf.d/20-debian_defaults 4 | if [ -f /etc/init.d/amavisd-new ]; then 5 | echo -n "Restarting Amavisd-new... " 6 | systemctl restart amavisd-new 7 | else 8 | echo -n "Restarting Amavisd... " 9 | systemctl restart amavis 10 | fi 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | if [ "$CFG_WEBMAIL" == "roundcube" ]; then 14 | mysql -uroot -p$CFG_MYSQL_ROOT_PWD dbispconfig -e "INSERT INTO remote_user (remote_userid, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other, remote_username, remote_password, remote_functions) VALUES (1, 1, 1, 'riud', 'riud', '', 'roundcube', MD5('$CFG_ROUNDCUBE_PWD'), 'server_get,get_function_list,client_templates_get_all,server_get_serverid_by_ip,server_ip_get,server_ip_add,server_ip_update,server_ip_delete;client_get_all,client_get,client_add,client_update,client_delete,client_get_sites_by_user,client_get_by_username,client_change_password,client_get_id,client_delete_everything;mail_user_get,mail_user_add,mail_user_update,mail_user_delete;mail_alias_get,mail_alias_add,mail_alias_update,mail_alias_delete;mail_spamfilter_user_get,mail_spamfilter_user_add,mail_spamfilter_user_update,mail_spamfilter_user_delete;mail_policy_get,mail_policy_add,mail_policy_update,mail_policy_delete;mail_fetchmail_get,mail_fetchmail_add,mail_fetchmail_update,mail_fetchmail_delete;mail_spamfilter_whitelist_get,mail_spamfilter_whitelist_add,mail_spamfilter_whitelist_update,mail_spamfilter_whitelist_delete;mail_spamfilter_blacklist_get,mail_spamfilter_blacklist_add,mail_spamfilter_blacklist_update,mail_spamfilter_blacklist_delete;mail_user_filter_get,mail_user_filter_add,mail_user_filter_update,mail_user_filter_delete');" 15 | ln -s /usr/local/ispconfig/interface/ssl/ispserver.crt /usr/local/share/ca-certificates/ispserver.crt 16 | update-ca-certificates > /dev/null 2>&1 17 | sed -i 's/;openssl.cafile=/openssl.cafile=\/etc\/ssl\/certs\/ca-certificates.crt/' /etc/php/7.3/apache2/php.ini 18 | sed -i 's/;openssl.cafile=/openssl.cafile=\/etc\/ssl\/certs\/ca-certificates.crt/' /etc/php/7.3/fpm/php.ini 19 | if [ "$CFG_WEBSERVER" == "apache" ]; then 20 | systemctl reload apache2 21 | systemctl reload php7.3-fpm 22 | elif [ "$CFG_WEBSERVER" == "nginx" ]; then 23 | systemctl reload nginx 24 | systemctl reload php7.3-fpm 25 | fi 26 | fi 27 | } 28 | -------------------------------------------------------------------------------- /distros/debian10/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections 8 | apt_install pure-ftpd-common pure-ftpd-mysql 9 | openssl dhparam -out /etc/ssl/private/pure-ftpd-dhparams.pem 2048 10 | sed -i 's/ftp/\#ftp/' /etc/inetd.conf 11 | echo 1 > /etc/pure-ftpd/conf/TLS 12 | mkdir -p /etc/ssl/private/ 13 | 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" 14 | chmod 600 /etc/ssl/private/pure-ftpd.pem 15 | echo -e "[${green}DONE${NC}]\n" 16 | echo -n "Restarting Pure-FTPd... " 17 | systemctl restart openbsd-inetd 18 | systemctl restart pure-ftpd-mysql 19 | echo -e "[${green}DONE${NC}]\n" 20 | } 21 | 22 | -------------------------------------------------------------------------------- /distros/debian10/install_hhvm.sh: -------------------------------------------------------------------------------- 1 | InstallHHVM() { 2 | if [ $CFG_SETUP_WEB = "yes" ]; then 3 | echo -n "Installing HHVM (Hip Hop Virtual Machine)... " 4 | apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 5 | echo deb http://dl.hhvm.com/debian stretch main | tee /etc/apt/sources.list.d/hhvm.list 6 | hide_output apt-get update 7 | apt_install hhvm 8 | echo -e "[${green}DONE${NC}]\n" 9 | fi 10 | } 11 | -------------------------------------------------------------------------------- /distros/debian10/install_ispconfigbeta.sh: -------------------------------------------------------------------------------- 1 | InstallISPConfigBeta() { 2 | # if [ $CFG_SETUP_WEB = "yes" ]; then 3 | # echo -e "Installing HHVM" 4 | # apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 5 | # echo deb http://dl.hhvm.com/debian jessie main | sudo tee /etc/apt/sources.list.d/hhvm.list 6 | # hide_output apt-get update 7 | # apt_install hhvm 8 | # echo -e "Installing Lets Encrypt" 9 | # mkdir /opt/certbot 10 | # wget -q https://dl.eff.org/certbot-auto -O /opt/certbot/certbot-auto 11 | # chmod a+x /opt/certbot/certbot-auto 12 | # /opt/certbot/certbot-auto 13 | # fi 14 | } 15 | -------------------------------------------------------------------------------- /distros/debian10/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.21" #Jailkit Version -> Maybe this can be automated 8 | SUM="d316dc22b9f3ab7464c8bd73c2539304" 9 | 10 | InstallJailkit() { 11 | echo -n "Installing Jailkit... " 12 | apt_install build-essential autoconf automake libtool flex bison debhelper binutils python 13 | cd /tmp 14 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 15 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 16 | echo -e "\n${red}Error: md5sum does not match${NC}" >&2 17 | echo "Please try running this script again" >&2 18 | exit 1 19 | fi 20 | tar xfz jailkit-$JKV.tar.gz 21 | cd jailkit-$JKV 22 | echo 5 > debian/compat 23 | ./debian/rules binary > /dev/null 2>&1 24 | cd .. 25 | hide_output dpkg -i jailkit_$JKV-1_*.deb 26 | rm -rf jailkit-$JKV* 27 | echo -e "[${green}DONE${NC}]\n" 28 | } 29 | 30 | -------------------------------------------------------------------------------- /distros/debian10/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | echo -n "Installing POP3/IMAP Mail server (Dovecot) and Mail signing (OpenDKIM, OpenDMARC)... "; 7 | apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd sudo 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/debian10/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallSQLServer 3 | # Install and configure SQL Server 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | echo -n "Installing Database server (MariaDB)... " 7 | echo "maria-db-10.1 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 8 | echo "maria-db-10.1 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 9 | apt_install mariadb-client mariadb-server 10 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1\nsql-mode="NO_ENGINE_SUBSTITUTION"/' /etc/mysql/mariadb.conf.d/50-server.cnf 11 | echo "update mysql.user set plugin = 'mysql_native_password' where user='root';" | mysql -u root 12 | sed -i 's/password =/password = '$CFG_MYSQL_ROOT_PWD'/' /etc/mysql/debian.cnf 13 | mysql -e "UPDATE mysql.user SET Password = PASSWORD('$CFG_MYSQL_ROOT_PWD') WHERE User = 'root'" 14 | # Make our changes take effect 15 | mysql -e "FLUSH PRIVILEGES" 16 | echo -e "[${green}DONE${NC}]\n" 17 | echo -n "Restarting MariaDB... " 18 | systemctl restart mysql 19 | echo -e "[${green}DONE${NC}]\n" 20 | } 21 | -------------------------------------------------------------------------------- /distros/debian10/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | if [ -f /etc/init.d/sendmail ]; then 7 | echo -n "Removing Sendmail... " 8 | systemctl stop sendmail 9 | hide_output update-rc.d -f sendmail remove 10 | apt_remove sendmail 11 | echo -e "[${green}DONE${NC}]\n" 12 | fi 13 | 14 | echo -n "Installing SMTP Mail server (Postfix)... " 15 | echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections 16 | echo "postfix postfix/mailname string $CFG_HOSTNAME_FQDN" | debconf-set-selections 17 | # apt_install postfix postfix-mysql postfix-doc getmail4 18 | apt_install postfix postfix-mysql postfix-doc postfix-pcre getmail4 ca-certificates 19 | sed -i "s/#submission inet n - y - - smtpd/submission inet n - - - - smtpd/" /etc/postfix/master.cf 20 | sed -i "s/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/" /etc/postfix/master.cf 21 | sed -i "s/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/" /etc/postfix/master.cf 22 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 23 | sed -i "s/#smtps inet n - y - - smtpd/smtps inet n - - - - smtpd/" /etc/postfix/master.cf 24 | sed -i "s/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/" /etc/postfix/master.cf 25 | sed -i "s/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/" /etc/postfix/master.cf 26 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 27 | sed -i "s/#tlsproxy unix - - y - 0 tlsproxy/tlsproxy unix - - y - 0 tlsproxy/" /etc/postfix/master.cf 28 | echo -e "[${green}DONE${NC}]\n" 29 | echo -n "Restarting Postfix... " 30 | systemctl restart postfix 31 | echo -e "[${green}DONE${NC}]\n" 32 | } 33 | -------------------------------------------------------------------------------- /distros/debian10/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | apt_install quota quotatool 8 | echo -e "[${green}DONE${NC}]\n" 9 | quotaoff -a 10 | 11 | if ! [ -f /proc/user_beancounters ]; then 12 | echo -n "Initializing Quota, this may take a while... " 13 | if [ "$(grep -c ',usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0' /etc/fstab)" -eq 0 ]; then 14 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 15 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 16 | fi 17 | mount -o remount / 18 | # rc.local is deprecated, so following no longer required 19 | #if ! [ -e /dev/root ]; then 20 | # Source: https://www.howtoforge.com/community/threads/new-install-jessie-issue-with-quota.71183/#post-342624 21 | # ROOT_PARTITION=$(awk '$2~"^/$" {print $1}' /etc/fstab) 22 | # ln -s "$ROOT_PARTITION" /dev/root 23 | # sed -i "/^exit 0/i ln -s $ROOT_PARTITION \/dev\/root" /etc/rc.local 24 | # sed -i '/^exit 0/i \/etc\/init.d\/quota restart\n' /etc/rc.local 25 | #fi 26 | quotacheck -avugm 27 | quotaon -avug 28 | echo -e "[${green}DONE${NC}]\n" 29 | fi 30 | } 31 | -------------------------------------------------------------------------------- /distros/debian10/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Webalizer and AWStats)... "; 7 | # apt_install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl libtimedate-perl 8 | apt_install webalizer awstats geoip-database libclass-dbi-mysql-perl libtimedate-perl 9 | sed -i 's/^/#/' /etc/cron.d/awstats 10 | echo -e "[${green}DONE${NC}]\n" 11 | } 12 | 13 | -------------------------------------------------------------------------------- /distros/debian10/phpmyadmin_nginx.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Confi_phpMyAdmin_nginx 3 | # Configure phpMyAdmin for nginx 4 | #--------------------------------------------------------------------- 5 | config_phpMyAdmin_nginx() { 6 | touch /etc/nginx/conf.d/phpmyadmin.conf 7 | # Write default ngnix vhost configuration file for phpmyadmin - to be included in all other hosts 8 | cat /etc/nginx/conf.d/phpmyadmin.conf < /etc/amavis/conf.d/05-node_id 10 | echo "chomp(\$myhostname = \`hostname --fqdn\`);" >> /etc/amavis/conf.d/05-node_id 11 | echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id 12 | echo "1;" >> /etc/amavis/conf.d/05-node_id 13 | echo "$CFG_HOSTNAME_FQDN" > /etc/mailname 14 | echo -e "[${green}DONE${NC}]\n" 15 | echo -n "Stopping SpamAssassin... " 16 | systemctl stop spamassassin 17 | echo -e "[${green}DONE${NC}]\n" 18 | echo -n "Disabling SpamAssassin... " 19 | hide_output systemctl disable spamassassin 20 | echo -e "[${green}DONE${NC}]\n" 21 | if [ "$CFG_AVUPDATE" == "yes" ]; then 22 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 23 | freshclam 24 | echo -e "[${green}DONE${NC}]\n" 25 | fi 26 | echo -n "Restarting ClamAV... " 27 | systemctl restart clamav-daemon 28 | echo -e "[${green}DONE${NC}]\n" 29 | } 30 | -------------------------------------------------------------------------------- /distros/debian11/install_basephp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasePhp Debian 10 3 | # Install Basic php need to run ispconfig 4 | #--------------------------------------------------------------------- 5 | InstallBasePhp(){ 6 | echo -n "Installing basic PHP modules... " 7 | apt_install php-cli php-mysql php-mcrypt mcrypt php-mbstring 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/debian11/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo -n "Updating apt package database and upgrading currently installed packages... " 7 | hide_output apt-get update 8 | # hide_output apt-get -y upgrade 9 | hide_output apt-get -y dist-upgrade 10 | hide_output apt-get -y autoremove 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | echo -n "Installing basic packages (OpenSSH server, NTP, binutils, etc.)... " 14 | apt_install ssh openssh-server nano vim-nox ntp debconf-utils binutils sudo git lsb-release e2fsprogs 15 | echo -e "[${green}DONE${NC}]\n" 16 | 17 | if [ /bin/sh -ef /bin/dash ]; then 18 | echo -n "Changing the default shell from dash to bash... " 19 | echo "dash dash/sh boolean false" | debconf-set-selections 20 | dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 21 | echo -e "[${green}DONE${NC}]\n" 22 | fi 23 | } 24 | -------------------------------------------------------------------------------- /distros/debian11/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | apt_install bind9 dnsutils 8 | echo -e "[${green}DONE${NC}]\n" 9 | echo -n "Installing haveged... "; 10 | apt_install haveged 11 | echo -e "[${green}DONE${NC}]\n" 12 | } 13 | -------------------------------------------------------------------------------- /distros/debian11/install_fail2ban.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFail2ban 3 | # Install and configure fail2ban 4 | #--------------------------------------------------------------------- 5 | InstallFail2ban() { 6 | echo -n "Installing Intrusion protection (Fail2Ban)... " 7 | apt_install fail2ban 8 | 9 | 10 | case $CFG_MTA in 11 | "courier") 12 | cat > /etc/fail2ban/jail.local < /etc/fail2ban/filter.d/courierpop3.conf <\] 46 | ignoreregex = 47 | EOF 48 | 49 | cat > /etc/fail2ban/filter.d/courierpop3s.conf <\] 52 | ignoreregex = 53 | EOF 54 | 55 | cat > /etc/fail2ban/filter.d/courierimap.conf <\] 58 | ignoreregex = 59 | EOF 60 | 61 | cat > /etc/fail2ban/filter.d/courierimaps.conf <\] 64 | ignoreregex = 65 | EOF 66 | ;; 67 | "dovecot") 68 | cat > /etc/fail2ban/jail.local <> /etc/fail2ban/jail.local <> /etc/amavis/conf.d/20-debian_defaults 4 | if [ -f /etc/init.d/amavisd-new ]; then 5 | echo -n "Restarting Amavisd-new... " 6 | systemctl restart amavisd-new 7 | else 8 | echo -n "Restarting Amavisd... " 9 | systemctl restart amavis 10 | fi 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | if [ "$CFG_WEBMAIL" == "roundcube" ]; then 14 | mysql -uroot -p$CFG_MYSQL_ROOT_PWD dbispconfig -e "INSERT INTO remote_user (remote_userid, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other, remote_username, remote_password, remote_functions) VALUES (1, 1, 1, 'riud', 'riud', '', 'roundcube', MD5('$CFG_ROUNDCUBE_PWD'), 'server_get,get_function_list,client_templates_get_all,server_get_serverid_by_ip,server_ip_get,server_ip_add,server_ip_update,server_ip_delete;client_get_all,client_get,client_add,client_update,client_delete,client_get_sites_by_user,client_get_by_username,client_change_password,client_get_id,client_delete_everything;mail_user_get,mail_user_add,mail_user_update,mail_user_delete;mail_alias_get,mail_alias_add,mail_alias_update,mail_alias_delete;mail_spamfilter_user_get,mail_spamfilter_user_add,mail_spamfilter_user_update,mail_spamfilter_user_delete;mail_policy_get,mail_policy_add,mail_policy_update,mail_policy_delete;mail_fetchmail_get,mail_fetchmail_add,mail_fetchmail_update,mail_fetchmail_delete;mail_spamfilter_whitelist_get,mail_spamfilter_whitelist_add,mail_spamfilter_whitelist_update,mail_spamfilter_whitelist_delete;mail_spamfilter_blacklist_get,mail_spamfilter_blacklist_add,mail_spamfilter_blacklist_update,mail_spamfilter_blacklist_delete;mail_user_filter_get,mail_user_filter_add,mail_user_filter_update,mail_user_filter_delete');" 15 | ln -s /usr/local/ispconfig/interface/ssl/ispserver.crt /usr/local/share/ca-certificates/ispserver.crt 16 | update-ca-certificates > /dev/null 2>&1 17 | sed -i 's/;openssl.cafile=/openssl.cafile=\/etc\/ssl\/certs\/ca-certificates.crt/' /etc/php/7.3/apache2/php.ini 18 | sed -i 's/;openssl.cafile=/openssl.cafile=\/etc\/ssl\/certs\/ca-certificates.crt/' /etc/php/7.3/fpm/php.ini 19 | if [ "$CFG_WEBSERVER" == "apache" ]; then 20 | systemctl reload apache2 21 | systemctl reload php7.3-fpm 22 | elif [ "$CFG_WEBSERVER" == "nginx" ]; then 23 | systemctl reload nginx 24 | systemctl reload php7.3-fpm 25 | fi 26 | fi 27 | } 28 | -------------------------------------------------------------------------------- /distros/debian11/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections 8 | apt_install pure-ftpd-common pure-ftpd-mysql 9 | openssl dhparam -out /etc/ssl/private/pure-ftpd-dhparams.pem 2048 10 | sed -i 's/ftp/\#ftp/' /etc/inetd.conf 11 | echo 1 > /etc/pure-ftpd/conf/TLS 12 | mkdir -p /etc/ssl/private/ 13 | 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" 14 | chmod 600 /etc/ssl/private/pure-ftpd.pem 15 | echo -e "[${green}DONE${NC}]\n" 16 | echo -n "Restarting Pure-FTPd... " 17 | systemctl restart openbsd-inetd 18 | systemctl restart pure-ftpd-mysql 19 | echo -e "[${green}DONE${NC}]\n" 20 | } 21 | 22 | -------------------------------------------------------------------------------- /distros/debian11/install_hhvm.sh: -------------------------------------------------------------------------------- 1 | InstallHHVM() { 2 | if [ $CFG_SETUP_WEB = "yes" ]; then 3 | echo -n "Installing HHVM (Hip Hop Virtual Machine)... " 4 | apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 5 | echo deb http://dl.hhvm.com/debian stretch main | tee /etc/apt/sources.list.d/hhvm.list 6 | hide_output apt-get update 7 | apt_install hhvm 8 | echo -e "[${green}DONE${NC}]\n" 9 | fi 10 | } 11 | -------------------------------------------------------------------------------- /distros/debian11/install_ispconfigbeta.sh: -------------------------------------------------------------------------------- 1 | InstallISPConfigBeta() { 2 | # if [ $CFG_SETUP_WEB = "yes" ]; then 3 | # echo -e "Installing HHVM" 4 | # apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 5 | # echo deb http://dl.hhvm.com/debian jessie main | sudo tee /etc/apt/sources.list.d/hhvm.list 6 | # hide_output apt-get update 7 | # apt_install hhvm 8 | # echo -e "Installing Lets Encrypt" 9 | # mkdir /opt/certbot 10 | # wget -q https://dl.eff.org/certbot-auto -O /opt/certbot/certbot-auto 11 | # chmod a+x /opt/certbot/certbot-auto 12 | # /opt/certbot/certbot-auto 13 | # fi 14 | } 15 | -------------------------------------------------------------------------------- /distros/debian11/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.21" #Jailkit Version -> Maybe this can be automated 8 | SUM="d316dc22b9f3ab7464c8bd73c2539304" 9 | 10 | InstallJailkit() { 11 | echo -n "Installing Jailkit... " 12 | apt_install build-essential autoconf automake libtool flex bison debhelper binutils python 13 | cd /tmp 14 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 15 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 16 | echo -e "\n${red}Error: md5sum does not match${NC}" >&2 17 | echo "Please try running this script again" >&2 18 | exit 1 19 | fi 20 | tar xfz jailkit-$JKV.tar.gz 21 | cd jailkit-$JKV 22 | echo 5 > debian/compat 23 | ./debian/rules binary > /dev/null 2>&1 24 | cd .. 25 | hide_output dpkg -i jailkit_$JKV-1_*.deb 26 | rm -rf jailkit-$JKV* 27 | echo -e "[${green}DONE${NC}]\n" 28 | } 29 | 30 | -------------------------------------------------------------------------------- /distros/debian11/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | echo -n "Installing POP3/IMAP Mail server (Dovecot) and Mail signing (OpenDKIM, OpenDMARC)... "; 7 | apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd sudo 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/debian11/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallSQLServer 3 | # Install and configure SQL Server 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | echo -n "Installing Database server (MariaDB)... " 7 | echo "maria-db-10.1 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 8 | echo "maria-db-10.1 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 9 | apt_install mariadb-client mariadb-server 10 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1\nsql-mode="NO_ENGINE_SUBSTITUTION"/' /etc/mysql/mariadb.conf.d/50-server.cnf 11 | echo "update mysql.user set plugin = 'mysql_native_password' where user='root';" | mysql -u root 12 | sed -i 's/password =/password = '$CFG_MYSQL_ROOT_PWD'/' /etc/mysql/debian.cnf 13 | mysql -e "UPDATE mysql.user SET Password = PASSWORD('$CFG_MYSQL_ROOT_PWD') WHERE User = 'root'" 14 | # Make our changes take effect 15 | mysql -e "FLUSH PRIVILEGES" 16 | echo -e "[${green}DONE${NC}]\n" 17 | echo -n "Restarting MariaDB... " 18 | systemctl restart mysql 19 | echo -e "[${green}DONE${NC}]\n" 20 | } 21 | -------------------------------------------------------------------------------- /distros/debian11/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | if [ -f /etc/init.d/sendmail ]; then 7 | echo -n "Removing Sendmail... " 8 | systemctl stop sendmail 9 | hide_output update-rc.d -f sendmail remove 10 | apt_remove sendmail 11 | echo -e "[${green}DONE${NC}]\n" 12 | fi 13 | 14 | echo -n "Installing SMTP Mail server (Postfix)... " 15 | echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections 16 | echo "postfix postfix/mailname string $CFG_HOSTNAME_FQDN" | debconf-set-selections 17 | # apt_install postfix postfix-mysql postfix-doc getmail4 18 | apt_install postfix postfix-mysql postfix-doc postfix-pcre ca-certificates 19 | sed -i "s/#submission inet n - y - - smtpd/submission inet n - - - - smtpd/" /etc/postfix/master.cf 20 | sed -i "s/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/" /etc/postfix/master.cf 21 | sed -i "s/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/" /etc/postfix/master.cf 22 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 23 | sed -i "s/#smtps inet n - y - - smtpd/smtps inet n - - - - smtpd/" /etc/postfix/master.cf 24 | sed -i "s/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/" /etc/postfix/master.cf 25 | sed -i "s/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/" /etc/postfix/master.cf 26 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 27 | sed -i "s/#tlsproxy unix - - y - 0 tlsproxy/tlsproxy unix - - y - 0 tlsproxy/" /etc/postfix/master.cf 28 | echo -e "[${green}DONE${NC}]\n" 29 | echo -n "Restarting Postfix... " 30 | systemctl restart postfix 31 | echo -e "[${green}DONE${NC}]\n" 32 | } 33 | -------------------------------------------------------------------------------- /distros/debian11/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | apt_install quota quotatool 8 | echo -e "[${green}DONE${NC}]\n" 9 | quotaoff -a 10 | 11 | if ! [ -f /proc/user_beancounters ]; then 12 | echo -n "Initializing Quota, this may take a while... " 13 | if [ "$(grep -c ',usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0' /etc/fstab)" -eq 0 ]; then 14 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 15 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 16 | fi 17 | mount -o remount / 18 | # rc.local is deprecated, so following no longer required 19 | #if ! [ -e /dev/root ]; then 20 | # Source: https://www.howtoforge.com/community/threads/new-install-jessie-issue-with-quota.71183/#post-342624 21 | # ROOT_PARTITION=$(awk '$2~"^/$" {print $1}' /etc/fstab) 22 | # ln -s "$ROOT_PARTITION" /dev/root 23 | # sed -i "/^exit 0/i ln -s $ROOT_PARTITION \/dev\/root" /etc/rc.local 24 | # sed -i '/^exit 0/i \/etc\/init.d\/quota restart\n' /etc/rc.local 25 | #fi 26 | quotacheck -avugm 27 | quotaon -avug 28 | echo -e "[${green}DONE${NC}]\n" 29 | fi 30 | } 31 | -------------------------------------------------------------------------------- /distros/debian11/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Webalizer and AWStats)... "; 7 | # apt_install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl libtimedate-perl 8 | #apt_install webalizer awstats geoip-database libclass-dbi-mysql-perl libtimedate-perl 9 | apt_install awstats geoip-database libclass-dbi-mysql-perl libtimedate-perl 10 | sed -i 's/^/#/' /etc/cron.d/awstats 11 | echo -e "[${green}DONE${NC}]\n" 12 | } 13 | 14 | -------------------------------------------------------------------------------- /distros/debian11/preinstallcheck.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: PreInstallCheck 3 | # Do some pre-install checks 4 | #--------------------------------------------------------------------- 5 | PreInstallCheck() { 6 | echo -n "Preparing to install... " 7 | # Check source.list 8 | contrib=$(grep 'contrib' /etc/apt/sources.list | grep -v "cdrom") 9 | nonfree=$(grep 'non-free' /etc/apt/sources.list | grep -v "cdrom") 10 | if [ -z "$contrib" ]; then 11 | if [ -z "$nonfree" ]; then 12 | sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; 13 | else 14 | sed -i 's/main/main contrib/' /etc/apt/sources.list; 15 | fi 16 | else 17 | if [ -z "$nonfree" ]; then 18 | sed -i 's/main/main non-free/' /etc/apt/sources.list; 19 | fi 20 | fi 21 | echo -e "[${green}DONE${NC}]\n" 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /distros/debian7/install_antivirus.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallAntiVirus 3 | # Install Amavisd, Spamassassin, ClamAV 4 | #--------------------------------------------------------------------- 5 | InstallAntiVirus() { 6 | echo -n "Installing Antivirus utilities (Amavisd-new, ClamAV), Spam filtering (SpamAssassin) and Rootkit detection (rkhunter)... " 7 | apt_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 unrar-free p7zip rpm2cpio tnef 8 | echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id 9 | echo -e "[${green}DONE${NC}]\n" 10 | echo -n "Stopping SpamAssassin... " 11 | service spamassassin stop 12 | echo -e "[${green}DONE${NC}]\n" 13 | echo -n "Disabling SpamAssassin... " 14 | hide_output systemctl disable spamassassin 15 | echo -e "[${green}DONE${NC}]\n" 16 | if [ "$CFG_AVUPDATE" == "yes" ]; then 17 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 18 | freshclam 19 | echo -e "[${green}DONE${NC}]\n" 20 | fi 21 | echo -n "Restarting ClamAV... " 22 | service clamav-daemon restart 23 | echo -e "[${green}DONE${NC}]\n" 24 | } 25 | -------------------------------------------------------------------------------- /distros/debian7/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo -n "Updating apt package database and upgrading currently installed packages... " 7 | hide_output apt-get update 8 | # hide_output apt-get -y upgrade 9 | hide_output apt-get -y dist-upgrade 10 | hide_output apt-get -y autoremove 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | echo -n "Installing basic packages (OpenSSH server, NTP, binutils, etc.)... " 14 | apt_install ssh openssh-server vim-nox ntp ntpdate debconf-utils binutils sudo git lsb-release 15 | echo -e "[${green}DONE${NC}]\n" 16 | 17 | if [ /bin/sh -ef /bin/dash ]; then 18 | echo -n "Changing the default shell from dash to bash... " 19 | echo "dash dash/sh boolean false" | debconf-set-selections 20 | dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 21 | echo -e "[${green}DONE${NC}]\n" 22 | fi 23 | } 24 | 25 | -------------------------------------------------------------------------------- /distros/debian7/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | apt_install bind9 dnsutils 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/debian7/install_fail2ban.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFail2ban 3 | # Install and configure fail2ban 4 | #--------------------------------------------------------------------- 5 | InstallFail2ban() { 6 | echo -n "Installing Intrusion protection (Fail2Ban)... " 7 | apt_install fail2ban 8 | 9 | 10 | case $CFG_MTA in 11 | "courier") 12 | cat > /etc/fail2ban/jail.local < /etc/fail2ban/filter.d/courierpop3.conf <\] 53 | ignoreregex = 54 | EOF 55 | 56 | cat > /etc/fail2ban/filter.d/courierpop3s.conf <\] 59 | ignoreregex = 60 | EOF 61 | 62 | cat > /etc/fail2ban/filter.d/courierimap.conf <\] 65 | ignoreregex = 66 | EOF 67 | 68 | cat > /etc/fail2ban/filter.d/courierimaps.conf <\] 71 | ignoreregex = 72 | EOF 73 | ;; 74 | "dovecot") 75 | cat > /etc/fail2ban/jail.local < /etc/fail2ban/filter.d/dovecot-pop3imap.conf <\S*),.* 88 | ignoreregex = 89 | EOF 90 | ;; 91 | esac 92 | 93 | cat >> /etc/fail2ban/jail.local < /etc/fail2ban/filter.d/pureftpd.conf <\) \[WARNING\] Authentication failed for user.* 105 | ignoreregex = 106 | EOF 107 | echo -e "[${green}DONE${NC}]\n" 108 | echo -n "Restarting Fail2Ban... " 109 | service fail2ban restart 110 | echo -e "[${green}DONE${NC}]\n" 111 | } 112 | 113 | -------------------------------------------------------------------------------- /distros/debian7/install_fix.sh: -------------------------------------------------------------------------------- 1 | InstallFix(){ 2 | if [ "$CFG_WEBMAIL" == "roundcube" ]; then 3 | echo -n "Installing Roundcube fix... " 4 | cd /tmp 5 | git clone https://github.com/w2c/ispconfig3_roundcube.git 6 | cd /tmp/ispconfig3_roundcube/ 7 | mv ispconfig3_* /var/lib/roundcube/plugins 8 | cd /var/lib/roundcube/plugins 9 | mv ispconfig3_account/config/config.inc.php.dist ispconfig3_account/config/config.inc.php 10 | read -p "If you heaven't done yet add roundcube remtoe user in ISPConfig, with the following permission: Server functions - Client functions - Mail user functions - Mail alias functions - Mail spamfilter user functions - Mail spamfilter policy functions - Mail fetchmail functions - Mail spamfilter whitelist functions - Mail spamfilter blacklist functions - Mail user filter functions" 11 | sed -i "s/\$rcmail_config\['plugins'\] = array();/\$rcmail_config\['plugins'\] = array(\"jqueryui\", \"ispconfig3_account\", \"ispconfig3_autoreply\", \"ispconfig3_pass\", \"ispconfig3_spam\", \"ispconfig3_fetchmail\", \"ispconfig3_filter\");/" /etc/roundcube/main.inc.php 12 | sed -i "s/\$rcmail_config\['skin'\] = 'default';/\$rcmail_config\['skin'\] = 'classic';/" /etc/roundcube/main.inc.php 13 | #nano /var/lib/roundcube/plugins/ispconfig3_account/config/config.inc.php # <---- This should not be a Part of Installer. Every Admi can add this after Installation 14 | echo -e "[${green}DONE${NC}]\n" 15 | fi 16 | if [ $CFG_DKIM == "n" ]; then 17 | mkdir -p /var/db/dkim/ 18 | amavisd-new genrsa /var/db/dkim/$CFG_HOSTNAME_FQDN.key.pem 19 | 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 20 | echo "\$enable_dkim_verification = 1;" >> /etc/amavis/conf.d/20-debian_defaults 21 | echo "\$enable_dkim_signing = 1;" >> /etc/amavis/conf.d/20-debian_defaults 22 | echo "dkim_key('$CFG_HOSTNAME_FQDN', 'dkim', '/var/db/dkim/$CFG_HOSTNAME_FQDN.key.pem');" >> /etc/amavis/conf.d/20-debian_defaults 23 | echo "@dkim_signature_options_bysender_maps = ({ '.' => { ttl => 21*24*3600, c => 'relaxed/simple' } } );" >> /etc/amavis/conf.d/20-debian_defaults 24 | MYNET=$(grep "mynetworks =" /etc/postfix/main.cf | sed 's/mynetworks = //') 25 | echo "@mynetworks = qw( $MYNET );" >> /etc/amavis/conf.d/20-debian_defaults 26 | if [ -f /etc/init.d/amavisd-new ]; then 27 | echo -n "Restarting Amavisd-new... " 28 | service amavisd-new restart 29 | else 30 | echo -n "Restarting Amavisd... " 31 | service amavis restart 32 | fi 33 | echo -e "[${green}DONE${NC}]\n" 34 | fi 35 | } 36 | -------------------------------------------------------------------------------- /distros/debian7/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections 8 | apt_install pure-ftpd-common pure-ftpd-mysql 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 15 | service pure-ftpd-mysql restart 16 | echo -e "[${green}DONE${NC}]\n" 17 | } 18 | 19 | -------------------------------------------------------------------------------- /distros/debian7/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.17" #Jailkit Version -> Maybe this can be automated 8 | SUM="7b5a68abe89a65e0e29458cc1fd9ad0b" 9 | 10 | InstallJailkit() { 11 | echo -n "Installing Jailkit... " 12 | apt_install build-essential autoconf automake1.9 libtool flex bison debhelper 13 | cd /tmp 14 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 15 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 16 | echo -e "\n${red}Error: md5sum does not match${NC}" >&2 17 | echo "Please try running this script again" >&2 18 | exit 1 19 | fi 20 | tar xfz jailkit-$JKV.tar.gz 21 | cd jailkit-$JKV 22 | ./debian/rules binary > /dev/null 2>&1 23 | cd .. 24 | hide_output dpkg -i jailkit_$JKV-1_*.deb 25 | rm -rf jailkit-$JKV 26 | echo -e "[${green}DONE${NC}]\n" 27 | } 28 | 29 | -------------------------------------------------------------------------------- /distros/debian7/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | case $CFG_MTA in 7 | "courier") 8 | echo -n "Installing POP3/IMAP Mail server (Courier)... "; 9 | echo "courier-base courier-base/webadmin-configmode boolean false" | debconf-set-selections 10 | echo "courier-ssl courier-ssl/certnotice note" | debconf-set-selections 11 | apt_install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop 12 | sed -i 's/START=no/START=yes/' /etc/default/saslauthd 13 | cd /etc/courier 14 | rm -f /etc/courier/imapd.pem 15 | rm -f /etc/courier/pop3d.pem 16 | rm -f /usr/lib/courier/imapd.pem 17 | rm -f /usr/lib/courier/pop3d.pem 18 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/imapd.cnf 19 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/pop3d.cnf 20 | mkimapdcert > /dev/null 2>&1 21 | mkpop3dcert > /dev/null 2>&1 22 | ln -s /usr/lib/courier/imapd.pem /etc/courier/imapd.pem 23 | ln -s /usr/lib/courier/pop3d.pem /etc/courier/pop3d.pem 24 | service courier-imap-ssl restart 25 | service courier-pop-ssl restart 26 | service courier-authdaemon restart 27 | service saslauthd restart 28 | echo -e "[${green}DONE${NC}]\n" 29 | ;; 30 | "dovecot") 31 | echo -n "Installing POP3/IMAP Mail server (Dovecot)... "; 32 | apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve 33 | echo -e "[${green}DONE${NC}]\n" 34 | ;; 35 | esac 36 | } 37 | -------------------------------------------------------------------------------- /distros/debian7/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallSQLServer 3 | # Install and configure SQL Server 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | echo -n "Installing Database server (MySQL)... " 7 | echo "mysql-server-5.1 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 8 | echo "mysql-server-5.1 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 9 | apt_install mysql-client mysql-server 10 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf 11 | echo -e "[${green}DONE${NC}]\n" 12 | echo -n "Restarting MySQL... " 13 | service mysql restart 14 | echo -e "[${green}DONE${NC}]\n" 15 | } 16 | -------------------------------------------------------------------------------- /distros/debian7/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | if [ -f /etc/init.d/sendmail ]; then 7 | echo -n "Removing Sendmail... " 8 | service sendmail stop 9 | hide_output update-rc.d -f sendmail remove 10 | apt_remove sendmail 11 | echo -e "[${green}DONE${NC}]\n" 12 | fi 13 | echo -n "Installing SMTP Mail server (Postfix)... " 14 | echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections 15 | echo "postfix postfix/mailname string $CFG_HOSTNAME_FQDN" | debconf-set-selections 16 | apt_install postfix postfix-mysql postfix-doc getmail4 17 | sed -i "s/#submission inet n - - - - smtpd/submission inet n - - - - smtpd/" /etc/postfix/master.cf 18 | sed -i "s/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/" /etc/postfix/master.cf 19 | sed -i "s/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/" /etc/postfix/master.cf 20 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes/" /etc/postfix/master.cf 21 | sed -i "s/# -o smtpd_client_restrictions=permit_sasl_authenticated,reject/ -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 22 | sed -i "s/#smtps inet n - - - - smtpd/smtps inet n - - - - smtpd/" /etc/postfix/master.cf 23 | sed -i "s/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/" /etc/postfix/master.cf 24 | sed -i "s/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/" /etc/postfix/master.cf 25 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes/" /etc/postfix/master.cf 26 | sed -i "s/# -o smtpd_client_restrictions=permit_sasl_authenticated,reject/ -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 27 | echo -e "[${green}DONE${NC}]\n" 28 | echo -n "Restarting Postfix... " 29 | service postfix restart 30 | echo -e "[${green}DONE${NC}]\n" 31 | } 32 | -------------------------------------------------------------------------------- /distros/debian7/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | apt_install quota quotatool 8 | echo -e "[${green}DONE${NC}]\n" 9 | 10 | if ! [ -f /proc/user_beancounters ]; then 11 | echo -n "Initializing Quota, this may take awhile... " 12 | if [ "$(grep -c ',usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0' /etc/fstab)" -eq 0 ]; then 13 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 14 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 15 | fi 16 | mount -o remount / 17 | if ! [ -e /dev/root ]; then 18 | # Source: https://www.howtoforge.com/community/threads/new-install-jessie-issue-with-quota.71183/#post-342624 19 | ROOT_PARTITION=$(awk '$2~"^/$" {print $1}' /etc/fstab) 20 | ln -s "$ROOT_PARTITION" /dev/root 21 | sed -i "/^exit 0/i ln -s $ROOT_PARTITION \/dev\/root" /etc/rc.local 22 | sed -i '/^exit 0/i \/etc\/init.d\/quota restart\n' /etc/rc.local 23 | fi 24 | quotacheck -avugm 25 | quotaon -avug 26 | echo -e "[${green}DONE${NC}]\n" 27 | fi 28 | } 29 | -------------------------------------------------------------------------------- /distros/debian7/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Vlogger, Webalizer and AWStats)... "; 7 | apt_install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl 8 | sed -i 's/^/#/' /etc/cron.d/awstats 9 | echo -e "[${green}DONE${NC}]\n" 10 | } 11 | 12 | -------------------------------------------------------------------------------- /distros/debian7/preinstallcheck.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: PreInstallCheck 3 | # Do some pre-install checks 4 | #--------------------------------------------------------------------- 5 | PreInstallCheck() { 6 | echo -n "Preparing to install... " 7 | # Check source.list 8 | contrib=$(grep contrib /etc/apt/sources.list | grep -v "cdrom") 9 | nonfree=$(grep non-free /etc/apt/sources.list | grep -v "cdrom") 10 | if [ -z "$contrib" ]; then 11 | if [ -z "$nonfree" ]; then 12 | sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; 13 | else 14 | sed -i 's/main/main contrib/' /etc/apt/sources.list; 15 | fi 16 | else 17 | if [ -z "$nonfree" ]; then 18 | sed -i 's/main/main non-free/' /etc/apt/sources.list; 19 | fi 20 | fi 21 | echo -e "[${green}DONE${NC}]\n" 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /distros/debian8/install_antivirus.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallAntiVirus 3 | # Install Amavisd, Spamassassin, ClamAV 4 | #--------------------------------------------------------------------- 5 | InstallAntiVirus() { 6 | echo -n "Installing Antivirus utilities (Amavisd-new, ClamAV), Spam filtering (SpamAssassin), Greylisting (Postgrey) and Rootkit detection (rkhunter)... (This may take awhile. Do not abort it...) " 7 | apt_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 postgrey rkhunter systemd unrar-free p7zip rpm2cpio tnef 8 | sed -i "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/" /etc/clamav/clamd.conf 9 | echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id 10 | echo -e "[${green}DONE${NC}]\n" 11 | echo -n "Stopping SpamAssassin... " 12 | service spamassassin stop 13 | echo -e "[${green}DONE${NC}]\n" 14 | echo -n "Disabling SpamAssassin... " 15 | hide_output systemctl disable spamassassin 16 | echo -e "[${green}DONE${NC}]\n" 17 | if [ "$CFG_AVUPDATE" == "yes" ]; then 18 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 19 | freshclam 20 | echo -e "[${green}DONE${NC}]\n" 21 | fi 22 | echo -n "Restarting ClamAV... " 23 | service clamav-daemon restart 24 | echo -e "[${green}DONE${NC}]\n" 25 | } 26 | -------------------------------------------------------------------------------- /distros/debian8/install_basephp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasePhp Debian 8 3 | # Install Basic php need to run ispconfig 4 | #--------------------------------------------------------------------- 5 | InstallBasePhp(){ 6 | echo -n "Installing basic PHP modules... " 7 | apt_install php5-cli php5-mysql php5-mcrypt mcrypt 8 | echo -e "[${green}DONE${NC}]\n" 9 | } -------------------------------------------------------------------------------- /distros/debian8/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo 'deb http://ftp.debian.org/debian jessie-backports main' >> /etc/apt/sources.list 7 | echo -n "Updating apt package database and upgrading currently installed packages... " 8 | hide_output apt-get update 9 | # hide_output apt-get -y upgrade 10 | hide_output apt-get -y dist-upgrade 11 | hide_output apt-get -y autoremove 12 | echo -e "[${green}DONE${NC}]\n" 13 | 14 | echo -n "Installing basic packages (OpenSSH server, NTP, binutils, etc.)... " 15 | apt_install ssh openssh-server nano vim-nox php5-cli ntp debconf-utils binutils sudo git lsb-release e2fsprogs 16 | echo -e "[${green}DONE${NC}]\n" 17 | 18 | if [ /bin/sh -ef /bin/dash ]; then 19 | echo -n "Changing the default shell from dash to bash... " 20 | echo "dash dash/sh boolean false" | debconf-set-selections 21 | dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 22 | echo -e "[${green}DONE${NC}]\n" 23 | fi 24 | } 25 | -------------------------------------------------------------------------------- /distros/debian8/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | apt_install bind9 dnsutils 8 | echo -e "[${green}DONE${NC}]\n" 9 | echo -n "Installing haveged... "; 10 | apt_install haveged 11 | echo -e "[${green}DONE${NC}]\n" 12 | } 13 | -------------------------------------------------------------------------------- /distros/debian8/install_fix.sh: -------------------------------------------------------------------------------- 1 | InstallFix(){ 2 | MYNET=$(grep "mynetworks =" /etc/postfix/main.cf | sed 's/mynetworks = //') 3 | echo "@mynetworks = qw( $MYNET );" >> /etc/amavis/conf.d/20-debian_defaults 4 | if [ -f /etc/init.d/amavisd-new ]; then 5 | echo -n "Restarting Amavisd-new... " 6 | service amavisd-new restart 7 | else 8 | echo -n "Restarting Amavisd... " 9 | service amavis restart 10 | fi 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | if [ "$CFG_WEBMAIL" == "roundcube" ]; then 14 | mysql -uroot -p$CFG_MYSQL_ROOT_PWD dbispconfig -e "INSERT INTO remote_user (remote_userid, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other, remote_username, remote_password, remote_functions) VALUES (1, 1, 1, 'riud', 'riud', '', 'roundcube', MD5('$CFG_ROUNDCUBE_PWD'), 'server_get,get_function_list,client_templates_get_all,server_get_serverid_by_ip,server_ip_get,server_ip_add,server_ip_update,server_ip_delete;client_get_all,client_get,client_add,client_update,client_delete,client_get_sites_by_user,client_get_by_username,client_change_password,client_get_id,client_delete_everything;mail_user_get,mail_user_add,mail_user_update,mail_user_delete;mail_alias_get,mail_alias_add,mail_alias_update,mail_alias_delete;mail_spamfilter_user_get,mail_spamfilter_user_add,mail_spamfilter_user_update,mail_spamfilter_user_delete;mail_policy_get,mail_policy_add,mail_policy_update,mail_policy_delete;mail_fetchmail_get,mail_fetchmail_add,mail_fetchmail_update,mail_fetchmail_delete;mail_spamfilter_whitelist_get,mail_spamfilter_whitelist_add,mail_spamfilter_whitelist_update,mail_spamfilter_whitelist_delete;mail_spamfilter_blacklist_get,mail_spamfilter_blacklist_add,mail_spamfilter_blacklist_update,mail_spamfilter_blacklist_delete;mail_user_filter_get,mail_user_filter_add,mail_user_filter_update,mail_user_filter_delete');" 15 | ln -s /usr/local/ispconfig/interface/ssl/ispserver.crt /usr/local/share/ca-certificates/ispserver.crt 16 | update-ca-certificates > /dev/null 2>&1 17 | sed -i 's/;openssl.cafile=/openssl.cafile=\/etc\/ssl\/certs\/ca-certificates.crt/' /etc/php5/apache2/php.ini 18 | sed -i 's/;openssl.cafile=/openssl.cafile=\/etc\/ssl\/certs\/ca-certificates.crt/' /etc/php5/fpm/php.ini 19 | if [ "$CFG_WEBSERVER" == "apache" ]; then 20 | service apache2 reload 21 | service php5-fpm reload 22 | elif [ "$CFG_WEBSERVER" == "nginx" ]; then 23 | service nginx reload 24 | service php5-fpm reload 25 | fi 26 | fi 27 | } 28 | -------------------------------------------------------------------------------- /distros/debian8/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections 8 | apt_install pure-ftpd-common pure-ftpd-mysql 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 | echo -e "[${green}DONE${NC}]\n" 15 | echo -n "Restarting Pure-FTPd... " 16 | service openbsd-inetd restart 17 | service pure-ftpd-mysql restart 18 | echo -e "[${green}DONE${NC}]\n" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /distros/debian8/install_hhvm.sh: -------------------------------------------------------------------------------- 1 | InstallHHVM() { 2 | if [ $CFG_SETUP_WEB = "yes" ]; then 3 | echo -n "Installing HHVM (Hip Hop Virtual Machine)... " 4 | apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 5 | echo deb http://dl.hhvm.com/debian jessie main | tee /etc/apt/sources.list.d/hhvm.list 6 | hide_output apt-get update 7 | apt_install hhvm 8 | echo -e "[${green}DONE${NC}]\n" 9 | fi 10 | } 11 | -------------------------------------------------------------------------------- /distros/debian8/install_ispconfigbeta.sh: -------------------------------------------------------------------------------- 1 | InstallISPConfigBeta() { 2 | # if [ $CFG_SETUP_WEB = "yes" ]; then 3 | # echo -e "Installing HHVM" 4 | # apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 5 | # echo deb http://dl.hhvm.com/debian jessie main | sudo tee /etc/apt/sources.list.d/hhvm.list 6 | # hide_output apt-get update 7 | # apt_install hhvm 8 | # echo -e "Installing Lets Encrypt" 9 | # mkdir /opt/certbot 10 | # wget -q https://dl.eff.org/certbot-auto -O /opt/certbot/certbot-auto 11 | # chmod a+x /opt/certbot/certbot-auto 12 | # /opt/certbot/certbot-auto 13 | # fi 14 | } 15 | -------------------------------------------------------------------------------- /distros/debian8/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.19" #Jailkit Version -> Maybe this can be automated 8 | SUM="f46cac122ac23b1825330d588407aa96" 9 | 10 | InstallJailkit() { 11 | echo -n "Installing Jailkit... " 12 | apt_install build-essential autoconf automake libtool flex bison debhelper binutils 13 | cd /tmp 14 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 15 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 16 | echo -e "\n${red}Error: md5sum does not match${NC}" >&2 17 | echo "Please try running this script again" >&2 18 | exit 1 19 | fi 20 | tar xfz jailkit-$JKV.tar.gz 21 | cd jailkit-$JKV 22 | ./debian/rules binary > /dev/null 2>&1 23 | cd .. 24 | hide_output dpkg -i jailkit_$JKV-1_*.deb 25 | rm -rf jailkit-$JKV 26 | echo -e "[${green}DONE${NC}]\n" 27 | } 28 | 29 | -------------------------------------------------------------------------------- /distros/debian8/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | case $CFG_MTA in 7 | "courier") 8 | echo -n "Installing POP3/IMAP Mail server (Courier) and Mail signing (OpenDKIM, OpenDMARC)... "; 9 | echo "courier-base courier-base/webadmin-configmode boolean false" | debconf-set-selections 10 | echo "courier-ssl courier-ssl/certnotice note" | debconf-set-selections 11 | apt_install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop opendkim opendkim-tools opendmarc 12 | sed -i 's/START=no/START=yes/' /etc/default/saslauthd 13 | cd /etc/courier 14 | rm -f /etc/courier/imapd.pem 15 | rm -f /etc/courier/pop3d.pem 16 | rm -f /usr/lib/courier/imapd.pem 17 | rm -f /usr/lib/courier/pop3d.pem 18 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/imapd.cnf 19 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/pop3d.cnf 20 | mkimapdcert > /dev/null 2>&1 21 | mkpop3dcert > /dev/null 2>&1 22 | ln -s /usr/lib/courier/imapd.pem /etc/courier/imapd.pem 23 | ln -s /usr/lib/courier/pop3d.pem /etc/courier/pop3d.pem 24 | service courier-imap-ssl restart 25 | service courier-pop-ssl restart 26 | service courier-authdaemon restart 27 | service saslauthd restart 28 | echo -e "[${green}DONE${NC}]\n" 29 | ;; 30 | "dovecot") 31 | echo -n "Installing POP3/IMAP Mail server (Dovecot) and Mail signing (OpenDKIM, OpenDMARC)... "; 32 | apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd opendkim opendkim-tools opendmarc 33 | echo -e "[${green}DONE${NC}]\n" 34 | ;; 35 | esac 36 | } 37 | -------------------------------------------------------------------------------- /distros/debian8/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallSQLServer 3 | # Install and configure SQL Server 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | if [ "$CFG_SQLSERVER" == "MySQL" ]; then 7 | echo -n "Installing Database server (MySQL)... " 8 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 9 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 10 | apt_install mysql-client mysql-server 11 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf 12 | echo -e "[${green}DONE${NC}]\n" 13 | echo -n "Restarting MySQL... " 14 | service mysql restart 15 | echo -e "[${green}DONE${NC}]\n" 16 | 17 | elif [ "$CFG_SQLSERVER" == "MariaDB" ]; then 18 | 19 | echo -n "Installing Database server (MariaDB)... " 20 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 21 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 22 | apt_install mariadb-client mariadb-server 23 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf 24 | echo -e "[${green}DONE${NC}]\n" 25 | echo -n "Restarting MariaDB... " 26 | service mysql restart 27 | echo -e "[${green}DONE${NC}]\n" 28 | fi 29 | } 30 | -------------------------------------------------------------------------------- /distros/debian8/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | if [ -f /etc/init.d/sendmail ]; then 7 | echo -n "Removing Sendmail... " 8 | service sendmail stop 9 | hide_output update-rc.d -f sendmail remove 10 | apt_remove sendmail 11 | echo -e "[${green}DONE${NC}]\n" 12 | fi 13 | 14 | echo -n "Installing SMTP Mail server (Postfix)... " 15 | echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections 16 | echo "postfix postfix/mailname string $CFG_HOSTNAME_FQDN" | debconf-set-selections 17 | apt_install postfix postfix-mysql postfix-doc getmail4 18 | sed -i "s/#submission inet n - - - - smtpd/submission inet n - - - - smtpd/" /etc/postfix/master.cf 19 | sed -i "s/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/" /etc/postfix/master.cf 20 | sed -i "s/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/" /etc/postfix/master.cf 21 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 22 | sed -i "s/#smtps inet n - - - - smtpd/smtps inet n - - - - smtpd/" /etc/postfix/master.cf 23 | sed -i "s/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/" /etc/postfix/master.cf 24 | sed -i "s/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/" /etc/postfix/master.cf 25 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 26 | echo -e "[${green}DONE${NC}]\n" 27 | echo -n "Restarting Postfix... " 28 | service postfix restart 29 | echo -e "[${green}DONE${NC}]\n" 30 | } 31 | -------------------------------------------------------------------------------- /distros/debian8/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | apt_install quota quotatool 8 | echo -e "[${green}DONE${NC}]\n" 9 | 10 | if ! [ -f /proc/user_beancounters ]; then 11 | echo -n "Initializing Quota, this may take awhile... " 12 | if [ "$(grep -c ',usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0' /etc/fstab)" -eq 0 ]; then 13 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 14 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 15 | fi 16 | mount -o remount / 17 | if ! [ -e /dev/root ]; then 18 | # Source: https://www.howtoforge.com/community/threads/new-install-jessie-issue-with-quota.71183/#post-342624 19 | ROOT_PARTITION=$(awk '$2~"^/$" {print $1}' /etc/fstab) 20 | ln -s "$ROOT_PARTITION" /dev/root 21 | sed -i "/^exit 0/i ln -s $ROOT_PARTITION \/dev\/root" /etc/rc.local 22 | sed -i '/^exit 0/i \/etc\/init.d\/quota restart\n' /etc/rc.local 23 | fi 24 | quotacheck -avugm 25 | quotaon -avug 26 | echo -e "[${green}DONE${NC}]\n" 27 | fi 28 | } 29 | -------------------------------------------------------------------------------- /distros/debian8/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Webalizer and AWStats)... "; 7 | # apt_install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl 8 | apt_install webalizer awstats geoip-database libclass-dbi-mysql-perl libtimedate-perl 9 | sed -i 's/^/#/' /etc/cron.d/awstats 10 | echo -e "[${green}DONE${NC}]\n" 11 | } 12 | 13 | -------------------------------------------------------------------------------- /distros/debian8/preinstallcheck.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: PreInstallCheck 3 | # Do some pre-install checks 4 | #--------------------------------------------------------------------- 5 | PreInstallCheck() { 6 | echo -n "Preparing to install... " 7 | # Check source.list 8 | contrib=$(grep contrib /etc/apt/sources.list | grep -v "cdrom") 9 | nonfree=$(grep non-free /etc/apt/sources.list | grep -v "cdrom") 10 | if [ -z "$contrib" ]; then 11 | if [ -z "$nonfree" ]; then 12 | sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; 13 | else 14 | sed -i 's/main/main contrib/' /etc/apt/sources.list; 15 | fi 16 | else 17 | if [ -z "$nonfree" ]; then 18 | sed -i 's/main/main non-free/' /etc/apt/sources.list; 19 | fi 20 | fi 21 | echo -e "[${green}DONE${NC}]\n" 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /distros/debian9/install_antivirus.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallAntiVirus 3 | # Install Amavisd, Spamassassin, ClamAV 4 | #--------------------------------------------------------------------- 5 | InstallAntiVirus() { 6 | echo -n "Installing Antivirus utilities (Amavisd-new, ClamAV), Spam filtering (SpamAssassin), Greylisting (Postgrey) and Rootkit detection (rkhunter)... (This may take awhile. Do not abort it...) " 7 | apt_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 libdbd-mysql-perl postgrey rkhunter systemd unrar-free p7zip rpm2cpio tnef razor pyzor libmail-dkim-perl 8 | sed -i "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/" /etc/clamav/clamd.conf 9 | echo "use strict;" > /etc/amavis/conf.d/05-node_id 10 | echo "chomp(\$myhostname = \`hostname --fqdn\`);" >> /etc/amavis/conf.d/05-node_id 11 | echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id 12 | echo "1;" >> /etc/amavis/conf.d/05-node_id 13 | echo "$CFG_HOSTNAME_FQDN" > /etc/mailname 14 | echo -e "[${green}DONE${NC}]\n" 15 | echo -n "Stopping SpamAssassin... " 16 | service spamassassin stop 17 | echo -e "[${green}DONE${NC}]\n" 18 | echo -n "Disabling SpamAssassin... " 19 | hide_output systemctl disable spamassassin 20 | echo -e "[${green}DONE${NC}]\n" 21 | if [ "$CFG_AVUPDATE" == "yes" ]; then 22 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 23 | freshclam 24 | echo -e "[${green}DONE${NC}]\n" 25 | fi 26 | echo -n "Restarting ClamAV... " 27 | service clamav-daemon restart 28 | echo -e "[${green}DONE${NC}]\n" 29 | } 30 | -------------------------------------------------------------------------------- /distros/debian9/install_basephp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasePhp Debian 9 3 | # Install Basic php need to run ispconfig 4 | #--------------------------------------------------------------------- 5 | InstallBasePhp(){ 6 | echo -n "Installing basic PHP modules... " 7 | apt_install php-cli php-mysql php-mcrypt mcrypt php-mbstring 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/debian9/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo -n "Updating apt package database and upgrading currently installed packages... " 7 | hide_output apt-get update 8 | # hide_output apt-get -y upgrade 9 | hide_output apt-get -y dist-upgrade 10 | hide_output apt-get -y autoremove 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | echo -n "Installing basic packages (OpenSSH server, NTP, binutils, etc.)... " 14 | apt_install ssh openssh-server nano vim-nox ntp debconf-utils binutils sudo git lsb-release e2fsprogs 15 | echo -e "[${green}DONE${NC}]\n" 16 | 17 | if [ /bin/sh -ef /bin/dash ]; then 18 | echo -n "Changing the default shell from dash to bash... " 19 | echo "dash dash/sh boolean false" | debconf-set-selections 20 | dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 21 | echo -e "[${green}DONE${NC}]\n" 22 | fi 23 | } 24 | -------------------------------------------------------------------------------- /distros/debian9/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | apt_install bind9 dnsutils 8 | echo -e "[${green}DONE${NC}]\n" 9 | echo -n "Installing haveged... "; 10 | apt_install haveged 11 | echo -e "[${green}DONE${NC}]\n" 12 | } 13 | -------------------------------------------------------------------------------- /distros/debian9/install_fail2ban.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFail2ban 3 | # Install and configure fail2ban 4 | #--------------------------------------------------------------------- 5 | InstallFail2ban() { 6 | echo -n "Installing Intrusion protection (Fail2Ban)... " 7 | apt_install fail2ban 8 | 9 | 10 | case $CFG_MTA in 11 | "courier") 12 | cat > /etc/fail2ban/jail.local < /etc/fail2ban/filter.d/courierpop3.conf <\] 46 | ignoreregex = 47 | EOF 48 | 49 | cat > /etc/fail2ban/filter.d/courierpop3s.conf <\] 52 | ignoreregex = 53 | EOF 54 | 55 | cat > /etc/fail2ban/filter.d/courierimap.conf <\] 58 | ignoreregex = 59 | EOF 60 | 61 | cat > /etc/fail2ban/filter.d/courierimaps.conf <\] 64 | ignoreregex = 65 | EOF 66 | ;; 67 | "dovecot") 68 | cat > /etc/fail2ban/jail.local <> /etc/fail2ban/jail.local <> /etc/amavis/conf.d/20-debian_defaults 4 | if [ -f /etc/init.d/amavisd-new ]; then 5 | echo -n "Restarting Amavisd-new... " 6 | service amavisd-new restart 7 | else 8 | echo -n "Restarting Amavisd... " 9 | service amavis restart 10 | fi 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | if [ "$CFG_WEBMAIL" == "roundcube" ]; then 14 | mysql -uroot -p$CFG_MYSQL_ROOT_PWD dbispconfig -e "INSERT INTO remote_user (remote_userid, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other, remote_username, remote_password, remote_functions) VALUES (1, 1, 1, 'riud', 'riud', '', 'roundcube', MD5('$CFG_ROUNDCUBE_PWD'), 'server_get,get_function_list,client_templates_get_all,server_get_serverid_by_ip,server_ip_get,server_ip_add,server_ip_update,server_ip_delete;client_get_all,client_get,client_add,client_update,client_delete,client_get_sites_by_user,client_get_by_username,client_change_password,client_get_id,client_delete_everything;mail_user_get,mail_user_add,mail_user_update,mail_user_delete;mail_alias_get,mail_alias_add,mail_alias_update,mail_alias_delete;mail_spamfilter_user_get,mail_spamfilter_user_add,mail_spamfilter_user_update,mail_spamfilter_user_delete;mail_policy_get,mail_policy_add,mail_policy_update,mail_policy_delete;mail_fetchmail_get,mail_fetchmail_add,mail_fetchmail_update,mail_fetchmail_delete;mail_spamfilter_whitelist_get,mail_spamfilter_whitelist_add,mail_spamfilter_whitelist_update,mail_spamfilter_whitelist_delete;mail_spamfilter_blacklist_get,mail_spamfilter_blacklist_add,mail_spamfilter_blacklist_update,mail_spamfilter_blacklist_delete;mail_user_filter_get,mail_user_filter_add,mail_user_filter_update,mail_user_filter_delete');" 15 | ln -s /usr/local/ispconfig/interface/ssl/ispserver.crt /usr/local/share/ca-certificates/ispserver.crt 16 | update-ca-certificates > /dev/null 2>&1 17 | sed -i 's/;openssl.cafile=/openssl.cafile=\/etc\/ssl\/certs\/ca-certificates.crt/' /etc/php/7.0/apache2/php.ini 18 | sed -i 's/;openssl.cafile=/openssl.cafile=\/etc\/ssl\/certs\/ca-certificates.crt/' /etc/php/7.0/fpm/php.ini 19 | if [ "$CFG_WEBSERVER" == "apache" ]; then 20 | service apache2 reload 21 | service php7.0-fpm reload 22 | elif [ "$CFG_WEBSERVER" == "nginx" ]; then 23 | service nginx reload 24 | service php7.0-fpm reload 25 | fi 26 | fi 27 | } 28 | -------------------------------------------------------------------------------- /distros/debian9/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections 8 | apt_install pure-ftpd-common pure-ftpd-mysql 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 | echo -e "[${green}DONE${NC}]\n" 15 | echo -n "Restarting Pure-FTPd... " 16 | service openbsd-inetd restart 17 | service pure-ftpd-mysql restart 18 | echo -e "[${green}DONE${NC}]\n" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /distros/debian9/install_hhvm.sh: -------------------------------------------------------------------------------- 1 | InstallHHVM() { 2 | if [ $CFG_SETUP_WEB = "yes" ]; then 3 | echo -n "Installing HHVM (Hip Hop Virtual Machine)... " 4 | apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 5 | echo deb http://dl.hhvm.com/debian stretch main | tee /etc/apt/sources.list.d/hhvm.list 6 | hide_output apt-get update 7 | apt_install hhvm 8 | echo -e "[${green}DONE${NC}]\n" 9 | fi 10 | } 11 | -------------------------------------------------------------------------------- /distros/debian9/install_ispconfigbeta.sh: -------------------------------------------------------------------------------- 1 | InstallISPConfigBeta() { 2 | # if [ $CFG_SETUP_WEB = "yes" ]; then 3 | # echo -e "Installing HHVM" 4 | # apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 5 | # echo deb http://dl.hhvm.com/debian jessie main | sudo tee /etc/apt/sources.list.d/hhvm.list 6 | # hide_output apt-get update 7 | # apt_install hhvm 8 | # echo -e "Installing Lets Encrypt" 9 | # mkdir /opt/certbot 10 | # wget -q https://dl.eff.org/certbot-auto -O /opt/certbot/certbot-auto 11 | # chmod a+x /opt/certbot/certbot-auto 12 | # /opt/certbot/certbot-auto 13 | # fi 14 | } 15 | -------------------------------------------------------------------------------- /distros/debian9/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.20" #Jailkit Version -> Maybe this can be automated 8 | SUM="b6d1653d915b9c9a190e185981f236e6" 9 | 10 | InstallJailkit() { 11 | echo -n "Installing Jailkit... " 12 | apt_install build-essential autoconf automake libtool flex bison debhelper binutils python 13 | cd /tmp 14 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 15 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 16 | echo -e "\n${red}Error: md5sum does not match${NC}" >&2 17 | echo "Please try running this script again" >&2 18 | exit 1 19 | fi 20 | tar xfz jailkit-$JKV.tar.gz 21 | cd jailkit-$JKV 22 | echo 5 > debian/compat 23 | ./debian/rules binary > /dev/null 2>&1 24 | cd .. 25 | hide_output dpkg -i jailkit_$JKV-1_*.deb 26 | rm -rf jailkit-$JKV 27 | echo -e "[${green}DONE${NC}]\n" 28 | } 29 | 30 | -------------------------------------------------------------------------------- /distros/debian9/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | echo -n "Installing POP3/IMAP Mail server (Dovecot) and Mail signing (OpenDKIM, OpenDMARC)... "; 7 | apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd dovecot-managesieved dovecot-lucene dovecot-antispam opendkim opendkim-tools opendmarc 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/debian9/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallSQLServer 3 | # Install and configure SQL Server 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | echo -n "Installing Database server (MariaDB)... " 7 | echo "maria-db-10.1 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 8 | echo "maria-db-10.1 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 9 | apt_install mariadb-client mariadb-server 10 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1\nsql-mode="NO_ENGINE_SUBSTITUTION"/' /etc/mysql/mariadb.conf.d/50-server.cnf 11 | echo "update mysql.user set plugin = 'mysql_native_password' where user='root';" | mysql -u root 12 | sed -i 's/password =/password = '$CFG_MYSQL_ROOT_PWD'/' /etc/mysql/debian.cnf 13 | mysql -e "UPDATE mysql.user SET Password = PASSWORD('$CFG_MYSQL_ROOT_PWD') WHERE User = 'root'" 14 | # Make our changes take effect 15 | mysql -e "FLUSH PRIVILEGES" 16 | echo -e "[${green}DONE${NC}]\n" 17 | echo -n "Restarting MariaDB... " 18 | service mysql restart 19 | echo -e "[${green}DONE${NC}]\n" 20 | } 21 | -------------------------------------------------------------------------------- /distros/debian9/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | if [ -f /etc/init.d/sendmail ]; then 7 | echo -n "Removing Sendmail... " 8 | service sendmail stop 9 | hide_output update-rc.d -f sendmail remove 10 | apt_remove sendmail 11 | echo -e "[${green}DONE${NC}]\n" 12 | fi 13 | 14 | echo -n "Installing SMTP Mail server (Postfix)... " 15 | echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections 16 | echo "postfix postfix/mailname string $CFG_HOSTNAME_FQDN" | debconf-set-selections 17 | # apt_install postfix postfix-mysql postfix-doc getmail4 18 | apt_install postfix postfix-mysql postfix-doc postfix-pcre getmail4 ca-certificates 19 | sed -i "s/#submission inet n - y - - smtpd/submission inet n - - - - smtpd/" /etc/postfix/master.cf 20 | sed -i "s/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/" /etc/postfix/master.cf 21 | sed -i "s/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/" /etc/postfix/master.cf 22 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 23 | sed -i "s/#smtps inet n - y - - smtpd/smtps inet n - - - - smtpd/" /etc/postfix/master.cf 24 | sed -i "s/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/" /etc/postfix/master.cf 25 | sed -i "s/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/" /etc/postfix/master.cf 26 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 27 | sed -i "s/#tlsproxy unix - - y - 0 tlsproxy/tlsproxy unix - - y - 0 tlsproxy/" /etc/postfix/master.cf 28 | echo -e "[${green}DONE${NC}]\n" 29 | echo -n "Restarting Postfix... " 30 | service postfix restart 31 | echo -e "[${green}DONE${NC}]\n" 32 | } 33 | -------------------------------------------------------------------------------- /distros/debian9/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | apt_install quota quotatool 8 | echo -e "[${green}DONE${NC}]\n" 9 | quotaoff -a 10 | 11 | if ! [ -f /proc/user_beancounters ]; then 12 | echo -n "Initializing Quota, this may take a while... " 13 | if [ "$(grep -c ',usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0' /etc/fstab)" -eq 0 ]; then 14 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 15 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 16 | fi 17 | mount -o remount / 18 | if ! [ -e /dev/root ]; then 19 | # Source: https://www.howtoforge.com/community/threads/new-install-jessie-issue-with-quota.71183/#post-342624 20 | ROOT_PARTITION=$(awk '$2~"^/$" {print $1}' /etc/fstab) 21 | ln -s "$ROOT_PARTITION" /dev/root 22 | sed -i "/^exit 0/i ln -s $ROOT_PARTITION \/dev\/root" /etc/rc.local 23 | sed -i '/^exit 0/i \/etc\/init.d\/quota restart\n' /etc/rc.local 24 | fi 25 | quotacheck -avugm 26 | quotaon -avug 27 | echo -e "[${green}DONE${NC}]\n" 28 | fi 29 | } 30 | -------------------------------------------------------------------------------- /distros/debian9/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Webalizer and AWStats)... "; 7 | # apt_install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl libtimedate-perl 8 | apt_install webalizer awstats geoip-database libclass-dbi-mysql-perl libtimedate-perl 9 | sed -i 's/^/#/' /etc/cron.d/awstats 10 | echo -e "[${green}DONE${NC}]\n" 11 | } 12 | 13 | -------------------------------------------------------------------------------- /distros/debian9/preinstallcheck.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: PreInstallCheck 3 | # Do some pre-install checks 4 | #--------------------------------------------------------------------- 5 | PreInstallCheck() { 6 | echo -n "Preparing to install... " 7 | # Check source.list 8 | contrib=$(grep 'contrib' /etc/apt/sources.list | grep -v "cdrom") 9 | nonfree=$(grep 'non-free' /etc/apt/sources.list | grep -v "cdrom") 10 | if [ -z "$contrib" ]; then 11 | if [ -z "$nonfree" ]; then 12 | sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; 13 | else 14 | sed -i 's/main/main contrib/' /etc/apt/sources.list; 15 | fi 16 | else 17 | if [ -z "$nonfree" ]; then 18 | sed -i 's/main/main non-free/' /etc/apt/sources.list; 19 | fi 20 | fi 21 | echo -e "[${green}DONE${NC}]\n" 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_antivirus.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallAntiVirus 3 | # Install Amavisd, Spamassassin, ClamAV 4 | #--------------------------------------------------------------------- 5 | InstallAntiVirus() { 6 | echo -n "Installing Antivirus utilities (Amavisd-new, ClamAV), Spam filtering (SpamAssassin) and Rootkit detection (rkhunter)... (This may take awhile. Do not abort it...) " 7 | apt_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 unrar-free p7zip rpm2cpio tnef razor pyzor libmail-dkim-perl 8 | sed -i "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/" /etc/clamav/clamd.conf 9 | echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id 10 | echo -e "[${green}DONE${NC}]\n" 11 | echo -n "Stopping SpamAssassin... " 12 | hide_output service spamassassin stop 13 | echo -e "[${green}DONE${NC}]\n" 14 | echo -n "Disabling SpamAssassin... " 15 | hide_output update-rc.d -f spamassassin remove 16 | echo -e "[${green}DONE${NC}]\n" 17 | if [ "$CFG_AVUPDATE" == "yes" ]; then 18 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 19 | freshclam 20 | echo -e "[${green}DONE${NC}]\n" 21 | fi 22 | echo -n "Restarting ClamAV... " 23 | hide_output service clamav-daemon restart 24 | echo -e "[${green}DONE${NC}]\n" 25 | } 26 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_basephp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasePhp Ubuntu 14.04 3 | # Install Basic php need to run ispconfig 4 | #--------------------------------------------------------------------- 5 | InstallBasePhp(){ 6 | echo -n "Installing basic PHP modules... " 7 | apt_install php5-cli php5-mysql php5-mcrypt mcrypt 8 | echo -e "[${green}DONE${NC}]\n" 9 | } -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo -n "Updating apt package database and upgrading currently installed packages... " 7 | hide_output apt-get update 8 | # hide_output apt-get -y upgrade 9 | hide_output apt-get -y dist-upgrade 10 | hide_output apt-get -y autoremove 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | echo -n "Installing basic packages (OpenSSH server, NTP, binutils, etc.)... " 14 | apt_install ssh openssh-server vim-nox php5-cli ntp ntpdate debconf-utils binutils sudo git lsb-release 15 | echo -e "[${green}DONE${NC}]\n" 16 | echo -n "Stopping AppArmor... " 17 | hide_output service apparmor stop 18 | echo -e "[${green}DONE${NC}]\n" 19 | echo -n "Disabling AppArmor... " 20 | hide_output update-rc.d -f apparmor remove 21 | echo -e "[${green}DONE${NC}]\n" 22 | echo -n "Removing AppArmor... " 23 | apt_remove apparmor apparmor-utils 24 | echo -e "[${green}DONE${NC}]\n" 25 | 26 | if [ /bin/sh -ef /bin/dash ]; then 27 | echo -n "Changing the default shell from dash to bash... " 28 | echo "dash dash/sh boolean false" | debconf-set-selections 29 | dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 30 | echo -e "[${green}DONE${NC}]\n" 31 | fi 32 | } 33 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | apt_install bind9 dnsutils 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_fix.sh: -------------------------------------------------------------------------------- 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=$(grep "mynetworks =" /etc/postfix/main.cf | 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 | echo -n "Restarting Amavisd-new... " 14 | hide_output service amavisd-new restart 15 | else 16 | echo -n "Restarting Amavisd... " 17 | hide_output service amavis restart 18 | fi 19 | echo -e "[${green}DONE${NC}]\n" 20 | fi 21 | } 22 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections 8 | apt_install pure-ftpd-common pure-ftpd-mysql 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 | echo -e "[${green}DONE${NC}]\n" 15 | echo -n "Restarting Pure-FTPd... " 16 | hide_output service openbsd-inetd restart 17 | hide_output service pure-ftpd-mysql restart 18 | echo -e "[${green}DONE${NC}]\n" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_hhvm.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallHHVM 3 | # Install HHVM 4 | #--------------------------------------------------------------------- 5 | InstallHHVM() { 6 | echo -n "Installing HHVM (Hip Hop Virtual Machine)... " 7 | # installs add-apt-repository 8 | apt_install software-properties-common 9 | apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 10 | add-apt-repository "deb http://dl.hhvm.com/ubuntu $(lsb_release -sc) main" 11 | hide_output apt-get update 12 | apt_install hhvm 13 | echo -e "[${green}DONE${NC}]\n" 14 | } 15 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.19" #Jailkit Version -> Maybe this can be automated 8 | SUM="f46cac122ac23b1825330d588407aa96" 9 | 10 | InstallJailkit() { 11 | echo -n "Installing Jailkit... " 12 | apt_install build-essential autoconf automake libtool flex bison debhelper binutils 13 | # cd /tmp 14 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 15 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 16 | echo -e "\n${red}Error: md5sum does not match${NC}" >&2 17 | echo "Please try running this script again" >&2 18 | exit 1 19 | fi 20 | tar xfz jailkit-$JKV.tar.gz 21 | cd jailkit-$JKV 22 | ./debian/rules binary > /dev/null 2>&1 23 | cd .. 24 | hide_output dpkg -i jailkit_$JKV-1_*.deb 25 | rm -rf jailkit-$JKV 26 | echo -e "[${green}DONE${NC}]\n" 27 | } 28 | 29 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_metronome.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMetronome 3 | # Install metronomeServer 4 | #--------------------------------------------------------------------- 5 | InstallMetronome() { 6 | echo -n "Installing Metronome... "; 7 | apt_install git lua5.1 liblua5.1-0-dev lua-filesystem libidn11-dev libssl-dev lua-zlib lua-expat lua-event lua-bitop lua-socket lua-sec luarocks luarocks 8 | luarocks install lpc 9 | adduser --no-create-home --disabled-login --gecos 'Metronome' metronome 10 | cd /opt; git clone https://github.com/maranda/metronome.git metronome 11 | cd ./metronome; ./configure --ostype=debian --prefix=/usr 12 | make 13 | make install 14 | cd /etc/metronome/certs && make localhost.key && make localhost.csr && make localhost.cert && chmod 0400 localhost.key && chown metronome localhost.key 15 | echo -e "[${green}DONE${NC}]\n" 16 | } 17 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | case $CFG_MTA in 7 | "courier") 8 | echo -n "Installing POP3/IMAP Mail server (Courier) and Mail signing (OpenDKIM, OpenDMARC)... "; 9 | echo "courier-base courier-base/webadmin-configmode boolean false" | debconf-set-selections 10 | echo "courier-ssl courier-ssl/certnotice note" | debconf-set-selections 11 | apt_install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop opendkim opendkim-tools opendmarc 12 | sed -i 's/START=no/START=yes/' /etc/default/saslauthd 13 | cd /etc/courier 14 | rm -f /etc/courier/imapd.pem 15 | rm -f /etc/courier/pop3d.pem 16 | rm -f /usr/lib/courier/imapd.pem 17 | rm -f /usr/lib/courier/pop3d.pem 18 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/imapd.cnf 19 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/pop3d.cnf 20 | mkimapdcert > /dev/null 2>&1 21 | mkpop3dcert > /dev/null 2>&1 22 | ln -s /usr/lib/courier/imapd.pem /etc/courier/imapd.pem 23 | ln -s /usr/lib/courier/pop3d.pem /etc/courier/pop3d.pem 24 | hide_output service courier-imap-ssl restart 25 | hide_output service courier-pop-ssl restart 26 | hide_output service courier-authdaemon restart 27 | hide_output service saslauthd restart 28 | echo -e "[${green}DONE${NC}]\n" 29 | ;; 30 | "dovecot") 31 | echo -n "Installing POP3/IMAP Mail server (Dovecot) and Mail signing (OpenDKIM, OpenDMARC)... "; 32 | echo "dovecot-core dovecot-core/create-ssl-cert boolean false" | debconf-set-selections 33 | echo "dovecot-core dovecot-core/ssl-cert-name string $CFG_HOSTNAME_FQDN" | debconf-set-selections 34 | apt_install dovecot-imapd dovecot-pop3d dovecot-sieve dovecot-mysql dovecot-lmtpd opendkim opendkim-tools opendmarc 35 | echo -e "[${green}DONE${NC}]\n" 36 | ;; 37 | esac 38 | } 39 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallSQLServer 3 | # Install and configure SQL Server 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | if [ "$CFG_SQLSERVER" == "MySQL" ]; then 7 | echo -n "Installing Database server (MySQL)... " 8 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 9 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 10 | apt_install mysql-client mysql-server 11 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf 12 | echo -e "[${green}DONE${NC}]\n" 13 | echo -n "Restarting MySQL... " 14 | hide_output service mysql restart 15 | echo -e "[${green}DONE${NC}]\n" 16 | 17 | elif [ "$CFG_SQLSERVER" == "MariaDB" ]; then 18 | 19 | echo -n "Installing Database server (MariaDB)... " 20 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 21 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 22 | apt_install mariadb-client mariadb-server 23 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf 24 | echo -e "[${green}DONE${NC}]\n" 25 | echo -n "Restarting MariaDB... " 26 | hide_output service mysql restart 27 | echo -e "[${green}DONE${NC}]\n" 28 | fi 29 | } 30 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | if [ -f /etc/init.d/sendmail ]; then 7 | echo -n "Removing Sendmail... " 8 | hide_output service sendmail stop 9 | hide_output update-rc.d -f sendmail remove 10 | apt_remove sendmail 11 | echo -e "[${green}DONE${NC}]\n" 12 | fi 13 | 14 | echo -n "Installing SMTP Mail server (Postfix)... " 15 | echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections 16 | echo "postfix postfix/mailname string $CFG_HOSTNAME_FQDN" | debconf-set-selections 17 | apt_install postfix postfix-mysql postfix-doc getmail4 18 | sed -i "s/#submission inet n - - - - smtpd/submission inet n - - - - smtpd/" /etc/postfix/master.cf 19 | sed -i "s/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/" /etc/postfix/master.cf 20 | sed -i "s/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/" /etc/postfix/master.cf 21 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 22 | sed -i "s/#smtps inet n - - - - smtpd/smtps inet n - - - - smtpd/" /etc/postfix/master.cf 23 | sed -i "s/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/" /etc/postfix/master.cf 24 | sed -i "s/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/" /etc/postfix/master.cf 25 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 26 | echo -e "[${green}DONE${NC}]\n" 27 | echo -n "Restarting Postfix... " 28 | hide_output service postfix restart 29 | echo -e "[${green}DONE${NC}]\n" 30 | } 31 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | apt_install quota quotatool 8 | echo -e "[${green}DONE${NC}]\n" 9 | 10 | if ! [ -f /proc/user_beancounters ]; then 11 | echo -n "Initializing Quota, this may take awhile... " 12 | if [ "$(grep -c ',usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0' /etc/fstab)" -eq 0 ]; then 13 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 14 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 15 | fi 16 | mount -o remount / 17 | quotacheck -avugm 18 | quotaon -avug 19 | echo -e "[${green}DONE${NC}]\n" 20 | fi 21 | } 22 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_webmail.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebmail 3 | # Install the chosen webmail client. Squirrelmail or Roundcube 4 | #--------------------------------------------------------------------- 5 | InstallWebmail() { 6 | echo -n "Installing Webmail client (SquirrelMail)... " 7 | echo "dictionaries-common dictionaries-common/default-wordlist select american (American English)" | debconf-set-selections 8 | apt_install squirrelmail wamerican 9 | ln -s /etc/squirrelmail/apache.conf /etc/apache2/conf-enabled/squirrelmail.conf 10 | sed -i 1d /etc/squirrelmail/apache.conf 11 | sed -i '1iAlias /webmail /usr/share/squirrelmail' /etc/squirrelmail/apache.conf 12 | 13 | case $CFG_MTA in 14 | "courier") 15 | sed -i 's/$imap_server_type = "other";/$imap_server_type = "courier";/' /etc/squirrelmail/config.php 16 | sed -i 's/$optional_delimiter = "detect";/$optional_delimiter = ".";/' /etc/squirrelmail/config.php 17 | sed -i 's/$default_folder_prefix = "";/$default_folder_prefix = "INBOX.";/' /etc/squirrelmail/config.php 18 | sed -i 's/$trash_folder = "INBOX.Trash";/$trash_folder = "Trash";/' /etc/squirrelmail/config.php 19 | sed -i 's/$sent_folder = "INBOX.Sent";/$sent_folder = "Sent";/' /etc/squirrelmail/config.php 20 | sed -i 's/$draft_folder = "INBOX.Drafts";/$draft_folder = "Drafts";/' /etc/squirrelmail/config.php 21 | sed -i 's/$default_sub_of_inbox = true;/$default_sub_of_inbox = false;/' /etc/squirrelmail/config.php 22 | sed -i 's/$delete_folder = false;/$delete_folder = true;/' /etc/squirrelmail/config.php 23 | ;; 24 | "dovecot") 25 | sed -i 's/$imap_server_type = "other";/$imap_server_type = "dovecot";/' /etc/squirrelmail/config.php 26 | sed -i 's/$trash_folder = "INBOX.Trash";/$trash_folder = "Trash";/' /etc/squirrelmail/config.php 27 | sed -i 's/$sent_folder = "INBOX.Sent";/$sent_folder = "Sent";/' /etc/squirrelmail/config.php 28 | sed -i 's/$draft_folder = "INBOX.Drafts";/$draft_folder = "Drafts";/' /etc/squirrelmail/config.php 29 | sed -i 's/$default_sub_of_inbox = true;/$default_sub_of_inbox = false;/' /etc/squirrelmail/config.php 30 | sed -i 's/$delete_folder = false;/$delete_folder = true;/' /etc/squirrelmail/config.php 31 | ;; 32 | esac 33 | mkdir /var/lib/squirrelmail/tmp 34 | chown www-data /var/lib/squirrelmail/tmp 35 | echo -e "[${green}DONE${NC}]\n" 36 | if [ "$CFG_WEBSERVER" == "apache" ]; then 37 | echo -n "Restarting Apache... " 38 | hide_output service apache2 restart 39 | elif [ "$CFG_WEBSERVER" == "nginx" ]; then 40 | echo -n "Restarting nginx... " 41 | hide_output service nginx restart 42 | fi 43 | echo -e "[${green}DONE${NC}]\n" 44 | } 45 | 46 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Vlogger, Webalizer and AWStats)... "; 7 | apt_install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl 8 | sed -i 's/^/#/' /etc/cron.d/awstats 9 | echo -e "[${green}DONE${NC}]\n" 10 | } 11 | 12 | -------------------------------------------------------------------------------- /distros/ubuntu-14.04/preinstallcheck.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: PreInstallCheck 3 | # Do some pre-install checks 4 | #--------------------------------------------------------------------- 5 | PreInstallCheck() { 6 | echo -n "Preparing to install... " 7 | # Check source.list 8 | #contrib=$(cat /etc/apt/sources.list | grep contrib | grep -v "cdrom") 9 | #nonfree=$(cat /etc/apt/sources.list | grep non-free | grep -v "cdrom") 10 | #if [ -z "$contrib" ]; then 11 | # if [ -z "$nonfree" ]; then 12 | # sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; 13 | # else 14 | # sed -i 's/main/main contrib/' /etc/apt/sources.list; 15 | # fi 16 | #else 17 | # if [ -z "$nonfree" ]; then 18 | # sed -i 's/main/main non-free/' /etc/apt/sources.list; 19 | # fi 20 | #fi 21 | echo -e "[${green}DONE${NC}]\n" 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/Install_metronome.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMetronome 3 | # Install metronomeServer 4 | #--------------------------------------------------------------------- 5 | InstallMetronome() { 6 | echo -n "Installing Metronome... "; 7 | apt_install git lua5.1 liblua5.1-0-dev lua-filesystem libidn11-dev libssl-dev lua-zlib lua-expat lua-event lua-bitop lua-socket lua-sec luarocks luarocks 8 | luarocks install lpc 9 | adduser --no-create-home --disabled-login --gecos 'Metronome' metronome 10 | cd /opt; git clone https://github.com/maranda/metronome.git metronome 11 | cd ./metronome; ./configure --ostype=debian --prefix=/usr 12 | make 13 | make install 14 | cd /etc/metronome/certs && make localhost.key && make localhost.csr && make localhost.cert && chmod 0400 localhost.key && chown metronome localhost.key 15 | echo -e "[${green}DONE${NC}]\n" 16 | } 17 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_antivirus.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallAntiVirus 3 | # Install Amavisd, Spamassassin, ClamAV 4 | #--------------------------------------------------------------------- 5 | InstallAntiVirus() { 6 | echo -n "Installing Antivirus utilities (Amavisd-new, ClamAV), Spam filtering (SpamAssassin) and Rootkit detection (rkhunter)... (This may take awhile. Do not abort it...) " 7 | apt_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 unrar-free p7zip rpm2cpio tnef 8 | sed -i "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/" /etc/clamav/clamd.conf 9 | echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id 10 | echo -e "[${green}DONE${NC}]\n" 11 | echo -n "Stopping SpamAssassin... " 12 | service spamassassin stop 13 | echo -e "[${green}DONE${NC}]\n" 14 | echo -n "Disabling SpamAssassin... " 15 | hide_output update-rc.d -f spamassassin remove 16 | echo -e "[${green}DONE${NC}]\n" 17 | if [ "$CFG_AVUPDATE" == "yes" ]; then 18 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 19 | freshclam 20 | echo -e "[${green}DONE${NC}]\n" 21 | fi 22 | echo -n "Restarting ClamAV... " 23 | service clamav-daemon restart 24 | echo -e "[${green}DONE${NC}]\n" 25 | } 26 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_basephp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasePhp Ubuntu 15.10 3 | # Install Basic php need to run ispconfig 4 | #--------------------------------------------------------------------- 5 | InstallBasePhp(){ 6 | echo -n "Installing basic PHP modules... " 7 | apt_install php5-cli php5-mysql php5-mcrypt mcrypt 8 | echo -e "[${green}DONE${NC}]\n" 9 | } -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo -n "Updating apt package database and upgrading currently installed packages... " 7 | hide_output apt-get update 8 | # hide_output apt-get -y upgrade 9 | hide_output apt-get -y dist-upgrade 10 | hide_output apt-get -y autoremove 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | echo -n "Installing basic packages (OpenSSH server, NTP, binutils, etc.)... " 14 | apt_install ssh openssh-server vim-nox php5-cli ntp ntpdate debconf-utils binutils sudo git lsb-release 15 | echo -e "[${green}DONE${NC}]\n" 16 | echo -n "Stopping AppArmor... " 17 | service apparmor stop 18 | echo -e "[${green}DONE${NC}]\n" 19 | echo -n "Disabling AppArmor... " 20 | hide_output update-rc.d -f apparmor remove 21 | echo -e "[${green}DONE${NC}]\n" 22 | echo -n "Removing AppArmor... " 23 | apt_remove apparmor apparmor-utils 24 | echo -e "[${green}DONE${NC}]\n" 25 | 26 | if [ /bin/sh -ef /bin/dash ]; then 27 | echo -n "Changing the default shell from dash to bash... " 28 | echo "dash dash/sh boolean false" | debconf-set-selections 29 | dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 30 | echo -e "[${green}DONE${NC}]\n" 31 | fi 32 | } 33 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | apt_install bind9 dnsutils 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_fix.sh: -------------------------------------------------------------------------------- 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=$(grep "mynetworks =" /etc/postfix/main.cf | 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 | echo -n "Restarting Amavisd-new... " 14 | service amavisd-new restart 15 | else 16 | echo -n "Restarting Amavisd... " 17 | service amavis restart 18 | fi 19 | echo -e "[${green}DONE${NC}]\n" 20 | fi 21 | } 22 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections 8 | apt_install pure-ftpd-common pure-ftpd-mysql 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 | echo -e "[${green}DONE${NC}]\n" 15 | echo -n "Restarting Pure-FTPd... " 16 | service openbsd-inetd restart 17 | service pure-ftpd-mysql restart 18 | echo -e "[${green}DONE${NC}]\n" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_hhvm.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallHHVM 3 | # Install HHVM 4 | #--------------------------------------------------------------------- 5 | InstallHHVM() { 6 | echo -n "Installing HHVM (Hip Hop Virtual Machine)... " 7 | # installs add-apt-repository 8 | apt_install software-properties-common 9 | apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 10 | add-apt-repository "deb http://dl.hhvm.com/ubuntu $(lsb_release -sc) main" 11 | hide_output apt-get update 12 | apt_install hhvm 13 | echo -e "[${green}DONE${NC}]\n" 14 | } 15 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.19" #Jailkit Version -> Maybe this can be automated 8 | SUM="f46cac122ac23b1825330d588407aa96" 9 | 10 | InstallJailkit() { 11 | echo -n "Installing Jailkit... " 12 | apt_install build-essential autoconf automake libtool flex bison debhelper binutils 13 | cd /tmp 14 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 15 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 16 | echo -e "\n${red}Error: md5sum does not match${NC}" >&2 17 | echo "Please try running this script again" >&2 18 | exit 1 19 | fi 20 | tar xfz jailkit-$JKV.tar.gz 21 | cd jailkit-$JKV 22 | ./debian/rules binary > /dev/null 2>&1 23 | cd .. 24 | hide_output dpkg -i jailkit_$JKV-1_*.deb 25 | rm -rf jailkit-$JKV 26 | echo -e "[${green}DONE${NC}]\n" 27 | } 28 | 29 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | case $CFG_MTA in 7 | "courier") 8 | echo -n "Installing POP3/IMAP Mail server (Courier) and Mail signing (OpenDKIM, OpenDMARC)... "; 9 | echo "courier-base courier-base/webadmin-configmode boolean false" | debconf-set-selections 10 | echo "courier-ssl courier-ssl/certnotice note" | debconf-set-selections 11 | apt_install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop opendkim opendkim-tools opendmarc 12 | sed -i 's/START=no/START=yes/' /etc/default/saslauthd 13 | cd /etc/courier 14 | rm -f /etc/courier/imapd.pem 15 | rm -f /etc/courier/pop3d.pem 16 | rm -f /usr/lib/courier/imapd.pem 17 | rm -f /usr/lib/courier/pop3d.pem 18 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/imapd.cnf 19 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/pop3d.cnf 20 | mkimapdcert > /dev/null 2>&1 21 | mkpop3dcert > /dev/null 2>&1 22 | ln -s /usr/lib/courier/imapd.pem /etc/courier/imapd.pem 23 | ln -s /usr/lib/courier/pop3d.pem /etc/courier/pop3d.pem 24 | service courier-imap-ssl restart 25 | service courier-pop-ssl restart 26 | service courier-authdaemon restart 27 | service saslauthd restart 28 | echo -e "[${green}DONE${NC}]\n" 29 | ;; 30 | "dovecot") 31 | echo -n "Installing POP3/IMAP Mail server (Dovecot) and Mail signing (OpenDKIM, OpenDMARC)... "; 32 | echo "dovecot-core dovecot-core/create-ssl-cert boolean false" | debconf-set-selections 33 | echo "dovecot-core dovecot-core/ssl-cert-name string $CFG_HOSTNAME_FQDN" | debconf-set-selections 34 | # apt_install dovecot-imapd dovecot-pop3d dovecot-sieve dovecot-mysql dovecot-lmtpd opendkim opendkim-tools opendmarc 35 | apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve opendkim opendkim-tools opendmarc 36 | echo -e "[${green}DONE${NC}]\n" 37 | ;; 38 | esac 39 | } 40 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallSQLServer 3 | # Install and configure SQL Server 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | if [ "$CFG_SQLSERVER" == "MySQL" ]; then 7 | echo -n "Installing Database server (MySQL)... " 8 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 9 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 10 | apt_install mysql-client mysql-server 11 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf 12 | echo -e "[${green}DONE${NC}]\n" 13 | echo -n "Restarting MySQL... " 14 | service mysql restart 15 | echo -e "[${green}DONE${NC}]\n" 16 | 17 | elif [ "$CFG_SQLSERVER" == "MariaDB" ]; then 18 | 19 | echo -n "Installing Database server (MariaDB)... " 20 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 21 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 22 | apt_install mariadb-client mariadb-server 23 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf 24 | echo -e "[${green}DONE${NC}]\n" 25 | echo -n "Restarting MariaDB... " 26 | service mysql restart 27 | echo -e "[${green}DONE${NC}]\n" 28 | fi 29 | } 30 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | if [ -f /etc/init.d/sendmail ]; then 7 | echo -n "Removing Sendmail... " 8 | service sendmail stop 9 | hide_output update-rc.d -f sendmail remove 10 | apt_remove sendmail 11 | echo -e "[${green}DONE${NC}]\n" 12 | fi 13 | 14 | echo -n "Installing SMTP Mail server (Postfix)... " 15 | echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections 16 | echo "postfix postfix/mailname string $CFG_HOSTNAME_FQDN" | debconf-set-selections 17 | apt_install postfix postfix-mysql postfix-doc getmail4 18 | sed -i "s/#submission inet n - - - - smtpd/submission inet n - - - - smtpd/" /etc/postfix/master.cf 19 | sed -i "s/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/" /etc/postfix/master.cf 20 | sed -i "s/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/" /etc/postfix/master.cf 21 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 22 | sed -i "s/#smtps inet n - - - - smtpd/smtps inet n - - - - smtpd/" /etc/postfix/master.cf 23 | sed -i "s/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/" /etc/postfix/master.cf 24 | sed -i "s/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/" /etc/postfix/master.cf 25 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 26 | echo -e "[${green}DONE${NC}]\n" 27 | echo -n "Restarting Postfix... " 28 | service postfix restart 29 | echo -e "[${green}DONE${NC}]\n" 30 | } 31 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | apt_install quota quotatool 8 | echo -e "[${green}DONE${NC}]\n" 9 | 10 | if ! [ -f /proc/user_beancounters ]; then 11 | echo -n "Initializing Quota, this may take awhile... " 12 | if [ "$(grep -c ',usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0' /etc/fstab)" -eq 0 ]; then 13 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 14 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 15 | fi 16 | mount -o remount / 17 | quotacheck -avugm 18 | quotaon -avug 19 | echo -e "[${green}DONE${NC}]\n" 20 | fi 21 | } 22 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_webmail.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebmail 3 | # Install the chosen webmail client. Squirrelmail or Roundcube 4 | #--------------------------------------------------------------------- 5 | InstallWebmail() { 6 | echo -n "Installing Webmail client (SquirrelMail)... " 7 | echo "dictionaries-common dictionaries-common/default-wordlist select american (American English)" | debconf-set-selections 8 | apt_install squirrelmail wamerican 9 | ln -s /etc/squirrelmail/apache.conf /etc/apache2/conf-enabled/squirrelmail.conf 10 | sed -i 1d /etc/squirrelmail/apache.conf 11 | sed -i '1iAlias /webmail /usr/share/squirrelmail' /etc/squirrelmail/apache.conf 12 | 13 | case $CFG_MTA in 14 | "courier") 15 | sed -i 's/$imap_server_type = "other";/$imap_server_type = "courier";/' /etc/squirrelmail/config.php 16 | sed -i 's/$optional_delimiter = "detect";/$optional_delimiter = ".";/' /etc/squirrelmail/config.php 17 | sed -i 's/$default_folder_prefix = "";/$default_folder_prefix = "INBOX.";/' /etc/squirrelmail/config.php 18 | sed -i 's/$trash_folder = "INBOX.Trash";/$trash_folder = "Trash";/' /etc/squirrelmail/config.php 19 | sed -i 's/$sent_folder = "INBOX.Sent";/$sent_folder = "Sent";/' /etc/squirrelmail/config.php 20 | sed -i 's/$draft_folder = "INBOX.Drafts";/$draft_folder = "Drafts";/' /etc/squirrelmail/config.php 21 | sed -i 's/$default_sub_of_inbox = true;/$default_sub_of_inbox = false;/' /etc/squirrelmail/config.php 22 | sed -i 's/$delete_folder = false;/$delete_folder = true;/' /etc/squirrelmail/config.php 23 | ;; 24 | "dovecot") 25 | sed -i 's/$imap_server_type = "other";/$imap_server_type = "dovecot";/' /etc/squirrelmail/config.php 26 | sed -i 's/$trash_folder = "INBOX.Trash";/$trash_folder = "Trash";/' /etc/squirrelmail/config.php 27 | sed -i 's/$sent_folder = "INBOX.Sent";/$sent_folder = "Sent";/' /etc/squirrelmail/config.php 28 | sed -i 's/$draft_folder = "INBOX.Drafts";/$draft_folder = "Drafts";/' /etc/squirrelmail/config.php 29 | sed -i 's/$default_sub_of_inbox = true;/$default_sub_of_inbox = false;/' /etc/squirrelmail/config.php 30 | sed -i 's/$delete_folder = false;/$delete_folder = true;/' /etc/squirrelmail/config.php 31 | ;; 32 | esac 33 | mkdir /var/lib/squirrelmail/tmp 34 | chown www-data /var/lib/squirrelmail/tmp 35 | echo -e "[${green}DONE${NC}]\n" 36 | if [ "$CFG_WEBSERVER" == "apache" ]; then 37 | echo -n "Restarting Apache... " 38 | service apache2 restart 39 | elif [ "$CFG_WEBSERVER" == "nginx" ]; then 40 | echo -n "Restarting nginx... " 41 | service nginx restart 42 | fi 43 | echo -e "[${green}DONE${NC}]\n" 44 | } 45 | 46 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Vlogger, Webalizer and AWStats)... "; 7 | apt_install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl 8 | sed -i 's/^/#/' /etc/cron.d/awstats 9 | echo -e "[${green}DONE${NC}]\n" 10 | } 11 | 12 | -------------------------------------------------------------------------------- /distros/ubuntu-15.10/preinstallcheck.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: PreInstallCheck 3 | # Do some pre-install checks 4 | #--------------------------------------------------------------------- 5 | PreInstallCheck() { 6 | echo -n "Preparing to install... " 7 | # Check source.list 8 | #contrib=$(cat /etc/apt/sources.list | grep contrib | grep -v "cdrom") 9 | #nonfree=$(cat /etc/apt/sources.list | grep non-free | grep -v "cdrom") 10 | #if [ -z "$contrib" ]; then 11 | # if [ -z "$nonfree" ]; then 12 | # sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; 13 | # else 14 | # sed -i 's/main/main contrib/' /etc/apt/sources.list; 15 | # fi 16 | #else 17 | # if [ -z "$nonfree" ]; then 18 | # sed -i 's/main/main non-free/' /etc/apt/sources.list; 19 | # fi 20 | #fi 21 | echo -e "${green} OK${NC}\n" 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_antivirus.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallAntiVirus Ubuntu 16.04 3 | # Install Amavisd, Spamassassin, ClamAV 4 | #--------------------------------------------------------------------- 5 | InstallAntiVirus() { 6 | echo -n -e "Installing Antivirus utilities (Amavisd-new, ClamAV), Spam filtering (SpamAssassin), Greylisting (Postgrey) and Rootkit detection (rkhunter)... [${red}(THIS MAY TAKE AWHILE. DO NOT ABORT!!!)${NC}]\n" 7 | apt_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 postgrey rkhunter razor pyzor libmail-dkim-perl 8 | echo -e "[${green}DONE${NC}]\n" 9 | 10 | sed -i "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/" /etc/clamav/clamd.conf 11 | echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id 12 | echo -n "Stopping SpamAssassin... " 13 | service spamassassin stop 14 | echo -e "[${green}DONE${NC}]\n" 15 | 16 | echo -n "Disabling SpamAssassin... " 17 | hide_output update-rc.d -f spamassassin remove 18 | echo -e "[${green}DONE${NC}]\n" 19 | 20 | if [ "$CFG_AVUPDATE" == "yes" ]; then 21 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 22 | freshclam 23 | echo -e "[${green}DONE${NC}]\n" 24 | fi 25 | 26 | echo -n "Restarting ClamAV... " 27 | service clamav-daemon restart 28 | echo -e "[${green}DONE${NC}]\n" 29 | } 30 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_basephp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasePhp Ubuntu 16.04 3 | # Install Basic php need to run ispconfig 4 | #--------------------------------------------------------------------- 5 | InstallBasePhp(){ 6 | echo -n "Installing basic PHP modules... " 7 | apt_install php7.0-cli php7.0-mysql php7.0-mcrypt mcrypt 8 | echo -e "[${green}DONE${NC}]\n" 9 | } -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo -n "Updating apt package database and upgrading currently installed packages... " 7 | hide_output apt-get update 8 | # hide_output apt-get -y upgrade 9 | hide_output apt-get -y dist-upgrade 10 | hide_output apt-get -y autoremove 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | echo -n "Installing basic packages (OpenSSH server, NTP, binutils, etc.)... " 14 | apt_install ssh openssh-server nano vim-nox php7.0-cli ntp ntpdate debconf-utils binutils sudo git lsb-release 15 | echo -e "[${green}DONE${NC}]\n" 16 | echo -n "Stopping AppArmor... " 17 | service apparmor stop 18 | echo -e "[${green}DONE${NC}]\n" 19 | echo -n "Disabling AppArmor... " 20 | hide_output update-rc.d -f apparmor remove 21 | echo -e "[${green}DONE${NC}]\n" 22 | echo -n "Removing AppArmor... " 23 | apt_remove apparmor apparmor-utils 24 | echo -e "[${green}DONE${NC}]\n" 25 | 26 | if [ /bin/sh -ef /bin/dash ]; then 27 | echo -n "Changing the default shell from dash to bash... " 28 | echo "dash dash/sh boolean false" | debconf-set-selections 29 | dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 30 | echo -e "[${green}DONE${NC}]\n" 31 | fi 32 | } 33 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | apt_install bind9 dnsutils haveged 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_fix.sh: -------------------------------------------------------------------------------- 1 | InstallFix(){ 2 | echo "@mynetworks = qw( $MYNET );" >> /etc/amavis/conf.d/20-debian_defaults 3 | if [ -f /etc/init.d/amavisd-new ]; then 4 | echo -n "Restarting Amavisd-new... " 5 | service amavisd-new restart 6 | else 7 | echo -n "Restarting Amavisd... " 8 | service amavis restart 9 | fi 10 | echo -e "[${green}DONE${NC}]\n" 11 | } 12 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections 8 | apt_install pure-ftpd-common pure-ftpd-mysql 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 | echo -e "[${green}DONE${NC}]\n" 15 | echo -n "Restarting Pure-FTPd... " 16 | service pure-ftpd-mysql restart 17 | echo -e "[${green}DONE${NC}]\n" 18 | } 19 | 20 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_hhvm.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallHHVM 3 | # Install HHVM 4 | #--------------------------------------------------------------------- 5 | InstallHHVM() { 6 | echo -n "Installing HHVM (Hip Hop Virtual Machine)... " 7 | # installs add-apt-repository 8 | apt_install software-properties-common 9 | apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 10 | add-apt-repository "deb http://dl.hhvm.com/ubuntu $(lsb_release -sc) main" 11 | hide_output apt-get update 12 | apt_install hhvm 13 | echo -e "[${green}DONE${NC}]\n" 14 | } 15 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.19" #Jailkit Version -> Maybe this can be automated 8 | SUM="f46cac122ac23b1825330d588407aa96" 9 | 10 | InstallJailkit() { 11 | echo -n "Installing Jailkit... " 12 | apt_install build-essential autoconf automake libtool flex bison debhelper binutils 13 | # cd /tmp 14 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 15 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 16 | echo -e "\n${red}Error: md5sum does not match${NC}" >&2 17 | echo "Please try running this script again" >&2 18 | exit 1 19 | fi 20 | tar xfz jailkit-$JKV.tar.gz 21 | cd jailkit-$JKV 22 | ./debian/rules binary > /dev/null 2>&1 23 | cd .. 24 | hide_output dpkg -i jailkit_$JKV-1_*.deb 25 | rm -rf jailkit-$JKV 26 | echo -e "[${green}DONE${NC}]\n" 27 | } 28 | 29 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_metronome.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMetronome 3 | # Install metronomeServer 4 | #--------------------------------------------------------------------- 5 | InstallMetronome() { 6 | echo -n "Installing Metronome... "; 7 | apt_install git lua5.1 liblua5.1-0-dev lua-filesystem libidn11-dev libssl-dev lua-zlib lua-expat lua-event lua-bitop lua-socket lua-sec luarocks luarocks 8 | luarocks install lpc 9 | adduser --no-create-home --disabled-login --gecos 'Metronome' metronome 10 | cd /opt; git clone https://github.com/maranda/metronome.git metronome 11 | cd ./metronome; ./configure --ostype=debian --prefix=/usr 12 | make 13 | make install 14 | echo -e "[${green}DONE${NC}]\n" 15 | } 16 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA Ubuntu 16.04 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | case $CFG_MTA in 7 | "courier") 8 | echo -n "Installing POP3/IMAP Mail server (Courier) and Mail signing (OpenDKIM, OpenDMARC)... "; 9 | echo "courier-base courier-base/webadmin-configmode boolean false" | debconf-set-selections 10 | echo "courier-ssl courier-ssl/certnotice note" | debconf-set-selections 11 | apt_install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop opendkim opendkim-tools opendmarc 12 | sed -i 's/START=no/START=yes/' /etc/default/saslauthd 13 | cd /etc/courier 14 | rm -f /etc/courier/imapd.pem 15 | rm -f /etc/courier/pop3d.pem 16 | rm -f /usr/lib/courier/imapd.pem 17 | rm -f /usr/lib/courier/pop3d.pem 18 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/imapd.cnf 19 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/pop3d.cnf 20 | mkimapdcert > /dev/null 2>&1 21 | mkpop3dcert > /dev/null 2>&1 22 | ln -s /usr/lib/courier/imapd.pem /etc/courier/imapd.pem 23 | ln -s /usr/lib/courier/pop3d.pem /etc/courier/pop3d.pem 24 | service courier-imap-ssl restart 25 | service courier-pop-ssl restart 26 | service courier-authdaemon restart 27 | service saslauthd restart 28 | echo -e "[${green}DONE${NC}]\n" 29 | ;; 30 | 31 | "dovecot") 32 | echo -n "Installing POP3/IMAP Mail server (Dovecot) and Mail signing (OpenDKIM, OpenDMARC)... "; 33 | echo "dovecot-core dovecot-core/create-ssl-cert boolean false" | debconf-set-selections 34 | echo "dovecot-core dovecot-core/ssl-cert-name string $CFG_HOSTNAME_FQDN" | debconf-set-selections 35 | apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd opendkim opendkim-tools opendmarc 36 | echo -e "[${green}DONE${NC}]\n" 37 | ;; 38 | esac 39 | } 40 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallSQLServer 3 | # Install and configure SQL Server 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | if [ "$CFG_SQLSERVER" == "MySQL" ]; then 7 | echo -n "Installing Database server (MySQL)... " 8 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 9 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 10 | apt_install mysql-client mysql-server 11 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/mysql.conf.d/mysqld.cnf 12 | echo "sql-mode=\"NO_ENGINE_SUBSTITUTION\"" >> /etc/mysql/mysql.conf.d/mysqld.cnf 13 | echo -e "[${green}DONE${NC}]\n" 14 | echo -n "Restarting MySQL... " 15 | service mysql restart 16 | echo -e "[${green}DONE${NC}]\n" 17 | 18 | elif [ "$CFG_SQLSERVER" == "MariaDB" ]; then 19 | 20 | echo -n "Installing Database server (MariaDB)... " 21 | #echo "mariadb-server-10.0 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 22 | #echo "mariadb-server-10.0 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 23 | apt_install mariadb-client mariadb-server 24 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/mariadb.conf.d/50-server.cnf 25 | echo -e "[${green}DONE${NC}]\n" 26 | echo -n "Restarting MariaDB... " 27 | service mysql restart 28 | echo -e "[${green}DONE${NC}]\n" 29 | fi 30 | } 31 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | if [ -f /etc/init.d/sendmail ]; then 7 | echo -n "Removing Sendmail... " 8 | service sendmail stop 9 | hide_output update-rc.d -f sendmail remove 10 | apt_remove sendmail 11 | echo -e "[${green}DONE${NC}]\n" 12 | fi 13 | 14 | echo -n "Installing SMTP Mail server (Postfix)... " 15 | echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections 16 | echo "postfix postfix/mailname string $CFG_HOSTNAME_FQDN" | debconf-set-selections 17 | apt_install postfix postfix-mysql postfix-doc getmail4 18 | sed -i "s/#submission inet n - y - - smtpd/submission inet n - y - - smtpd/" /etc/postfix/master.cf 19 | sed -i "s/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/" /etc/postfix/master.cf 20 | sed -i "s/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/" /etc/postfix/master.cf 21 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\n -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 22 | sed -i "s/#smtps inet n - y - - smtpd/smtps inet n - y - - smtpd/" /etc/postfix/master.cf 23 | sed -i "s/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/" /etc/postfix/master.cf 24 | sed -i "s/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/" /etc/postfix/master.cf 25 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\n -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 26 | echo -e "[${green}DONE${NC}]\n" 27 | echo -n "Restarting Postfix... " 28 | service postfix restart 29 | echo -e "[${green}DONE${NC}]\n" 30 | } 31 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | apt_install quota quotatool 8 | echo -e "[${green}DONE${NC}]\n" 9 | 10 | if ! [ -f /proc/user_beancounters ]; then 11 | echo -n "Initializing Quota, this may take awhile... " 12 | if [ "$(grep -c ',usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0' /etc/fstab)" -eq 0 ]; then 13 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 14 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 15 | fi 16 | mount -o remount / 17 | quotacheck -avugm 18 | quotaon -avug 19 | echo -e "[${green}DONE${NC}]\n" 20 | fi 21 | } 22 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Vlogger, Webalizer and AWStats)... "; 7 | apt_install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl 8 | sed -i 's/^/#/' /etc/cron.d/awstats 9 | echo -e "[${green}DONE${NC}]\n" 10 | } 11 | 12 | -------------------------------------------------------------------------------- /distros/ubuntu-16.04/preinstallcheck.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: PreInstallCheck 3 | # Do some pre-install checks 4 | #--------------------------------------------------------------------- 5 | PreInstallCheck() { 6 | echo -n "Preparing to install... " 7 | # Check source.list 8 | #contrib=$(cat /etc/apt/sources.list | grep contrib | grep -v "cdrom") 9 | #nonfree=$(cat /etc/apt/sources.list | grep non-free | grep -v "cdrom") 10 | #if [ -z "$contrib" ]; then 11 | # if [ -z "$nonfree" ]; then 12 | # sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; 13 | # else 14 | # sed -i 's/main/main contrib/' /etc/apt/sources.list; 15 | # fi 16 | #else 17 | # if [ -z "$nonfree" ]; then 18 | # sed -i 's/main/main non-free/' /etc/apt/sources.list; 19 | # fi 20 | #fi 21 | echo -e "[${green}DONE${NC}]\n" 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_antivirus.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallAntiVirus 3 | # Install Amavisd, Spamassassin, ClamAV 4 | #--------------------------------------------------------------------- 5 | InstallAntiVirus() { 6 | echo -n "Installing Antivirus utilities (Amavisd-new, ClamAV), Spam filtering (SpamAssassin), Greylisting (Postgrey) and Rootkit detection (rkhunter)... (This may take awhile. Do not abort it...) " 7 | apt_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 postgrey rkhunter 8 | sed -i "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/" /etc/clamav/clamd.conf 9 | echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id 10 | echo -e "[${green}DONE${NC}]\n" 11 | echo -n "Stopping SpamAssassin... " 12 | service spamassassin stop 13 | echo -e "[${green}DONE${NC}]\n" 14 | echo -n "Disabling SpamAssassin... " 15 | hide_output update-rc.d -f spamassassin remove 16 | echo -e "[${green}DONE${NC}]\n" 17 | if [ "$CFG_AVUPDATE" == "yes" ]; then 18 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 19 | freshclam 20 | echo -e "[${green}DONE${NC}]\n" 21 | fi 22 | echo -n "Restarting ClamAV... " 23 | service clamav-daemon restart 24 | echo -e "[${green}DONE${NC}]\n" 25 | } 26 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_basephp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasePhp Ubuntu 16.10 3 | # Install Basic php need to run ispconfig 4 | #--------------------------------------------------------------------- 5 | InstallBasePhp(){ 6 | echo -n "Installing basic PHP modules... " 7 | apt_install php5-cli php5-mysql php5-mcrypt mcrypt 8 | echo -e "[${green}DONE${NC}]\n" 9 | } -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo -n "Updating apt package database and upgrading currently installed packages... " 7 | hide_output apt-get update 8 | # hide_output apt-get -y upgrade 9 | hide_output apt-get -y dist-upgrade 10 | hide_output apt-get -y autoremove 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | echo -n "Installing basic packages (OpenSSH server, NTP, binutils, etc.)... " 14 | apt_install ssh openssh-server vim-nox php5-cli ntp ntpdate debconf-utils binutils sudo git lsb-release 15 | echo -e "[${green}DONE${NC}]\n" 16 | echo -n "Stopping AppArmor... " 17 | service apparmor stop 18 | echo -e "[${green}DONE${NC}]\n" 19 | echo -n "Disabling AppArmor... " 20 | hide_output update-rc.d -f apparmor remove 21 | echo -e "[${green}DONE${NC}]\n" 22 | echo -n "Removing AppArmor... " 23 | apt_remove apparmor apparmor-utils 24 | echo -e "[${green}DONE${NC}]\n" 25 | 26 | if [ /bin/sh -ef /bin/dash ]; then 27 | echo -n "Changing the default shell from dash to bash... " 28 | echo "dash dash/sh boolean false" | debconf-set-selections 29 | dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 30 | echo -e "[${green}DONE${NC}]\n" 31 | fi 32 | } 33 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | apt_install bind9 dnsutils haveged 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_fix.sh: -------------------------------------------------------------------------------- 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=$(grep "mynetworks =" /etc/postfix/main.cf | 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 | echo -n "Restarting Amavisd-new... " 14 | service amavisd-new restart 15 | else 16 | echo -n "Restarting Amavisd... " 17 | service amavis restart 18 | fi 19 | echo -e "[${green}DONE${NC}]\n" 20 | fi 21 | } 22 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections 8 | apt_install pure-ftpd-common pure-ftpd-mysql 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 | echo -e "[${green}DONE${NC}]\n" 15 | echo -n "Restarting Pure-FTPd... " 16 | service openbsd-inetd restart 17 | service pure-ftpd-mysql restart 18 | echo -e "[${green}DONE${NC}]\n" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_hhvm.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallHHVM 3 | # Install HHVM 4 | #--------------------------------------------------------------------- 5 | InstallHHVM() { 6 | echo -n "Installing HHVM (Hip Hop Virtual Machine)... " 7 | # installs add-apt-repository 8 | apt_install software-properties-common 9 | apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 10 | add-apt-repository "deb http://dl.hhvm.com/ubuntu $(lsb_release -sc) main" 11 | hide_output apt-get update 12 | apt_install hhvm 13 | echo -e "[${green}DONE${NC}]\n" 14 | } 15 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.19" #Jailkit Version -> Maybe this can be automated 8 | SUM="f46cac122ac23b1825330d588407aa96" 9 | 10 | InstallJailkit() { 11 | echo -n "Installing Jailkit... " 12 | apt_install build-essential autoconf automake libtool flex bison debhelper binutils 13 | cd /tmp 14 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 15 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 16 | echo -e "\n${red}Error: md5sum does not match${NC}" >&2 17 | echo "Please try running this script again" >&2 18 | exit 1 19 | fi 20 | tar xfz jailkit-$JKV.tar.gz 21 | cd jailkit-$JKV 22 | ./debian/rules binary > /dev/null 2>&1 23 | cd .. 24 | hide_output dpkg -i jailkit_$JKV-1_*.deb 25 | rm -rf jailkit-$JKV 26 | echo -e "[${green}DONE${NC}]\n" 27 | } 28 | 29 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_metronome.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMetronome 3 | # Install metronomeServer 4 | #--------------------------------------------------------------------- 5 | InstallMetronome() { 6 | echo -n "Installing Metronome... "; 7 | apt_install git lua5.1 liblua5.1-0-dev lua-filesystem libidn11-dev libssl-dev lua-zlib lua-expat lua-event lua-bitop lua-socket lua-sec luarocks luarocks 8 | luarocks install lpc 9 | adduser --no-create-home --disabled-login --gecos 'Metronome' metronome 10 | cd /opt; git clone https://github.com/maranda/metronome.git metronome 11 | cd ./metronome; ./configure --ostype=debian --prefix=/usr 12 | make 13 | make install 14 | cd /etc/metronome/certs && make localhost.key && make localhost.csr && make localhost.cert && chmod 0400 localhost.key && chown metronome localhost.key 15 | echo -e "[${green}DONE${NC}]\n" 16 | } 17 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | case $CFG_MTA in 7 | "courier") 8 | echo -n "Installing POP3/IMAP Mail server (Courier) and Mail signing (OpenDKIM, OpenDMARC)... "; 9 | echo "courier-base courier-base/webadmin-configmode boolean false" | debconf-set-selections 10 | echo "courier-ssl courier-ssl/certnotice note" | debconf-set-selections 11 | apt_install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop opendkim opendkim-tools opendmarc 12 | sed -i 's/START=no/START=yes/' /etc/default/saslauthd 13 | cd /etc/courier 14 | rm -f /etc/courier/imapd.pem 15 | rm -f /etc/courier/pop3d.pem 16 | rm -f /usr/lib/courier/imapd.pem 17 | rm -f /usr/lib/courier/pop3d.pem 18 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/imapd.cnf 19 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/pop3d.cnf 20 | mkimapdcert > /dev/null 2>&1 21 | mkpop3dcert > /dev/null 2>&1 22 | ln -s /usr/lib/courier/imapd.pem /etc/courier/imapd.pem 23 | ln -s /usr/lib/courier/pop3d.pem /etc/courier/pop3d.pem 24 | service courier-imap-ssl restart 25 | service courier-pop-ssl restart 26 | service courier-authdaemon restart 27 | service saslauthd restart 28 | echo -e "[${green}DONE${NC}]\n" 29 | ;; 30 | "dovecot") 31 | echo -n "Installing POP3/IMAP Mail server (Dovecot) and Mail signing (OpenDKIM, OpenDMARC)... "; 32 | echo "dovecot-core dovecot-core/create-ssl-cert boolean false" | debconf-set-selections 33 | echo "dovecot-core dovecot-core/ssl-cert-name string $CFG_HOSTNAME_FQDN" | debconf-set-selections 34 | apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd opendkim opendkim-tools opendmarc 35 | echo -e "[${green}DONE${NC}]\n" 36 | ;; 37 | esac 38 | } 39 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallSQLServer 3 | # Install and configure SQL Server 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | if [ "$CFG_SQLSERVER" == "MySQL" ]; then 7 | echo -n "Installing Database server (MySQL)... " 8 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 9 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 10 | apt_install mysql-client mysql-server 11 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf 12 | echo -e "[${green}DONE${NC}]\n" 13 | echo -n "Restarting MySQL... " 14 | service mysql restart 15 | echo -e "[${green}DONE${NC}]\n" 16 | 17 | elif [ "$CFG_SQLSERVER" == "MariaDB" ]; then 18 | 19 | echo -n "Installing Database server (MariaDB)... " 20 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 21 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 22 | apt_install mariadb-client mariadb-server 23 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf 24 | echo -e "[${green}DONE${NC}]\n" 25 | echo -n "Restarting MariaDB... " 26 | service mysql restart 27 | echo -e "[${green}DONE${NC}]\n" 28 | fi 29 | } 30 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | if [ -f /etc/init.d/sendmail ]; then 7 | echo -n "Removing Sendmail... " 8 | service sendmail stop 9 | hide_output update-rc.d -f sendmail remove 10 | apt_remove sendmail 11 | echo -e "[${green}DONE${NC}]\n" 12 | fi 13 | 14 | echo -n "Installing SMTP Mail server (Postfix)... " 15 | echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections 16 | echo "postfix postfix/mailname string $CFG_HOSTNAME_FQDN" | debconf-set-selections 17 | apt_install postfix postfix-mysql postfix-doc getmail4 18 | sed -i "s/#submission inet n - - - - smtpd/submission inet n - - - - smtpd/" /etc/postfix/master.cf 19 | sed -i "s/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/" /etc/postfix/master.cf 20 | sed -i "s/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/" /etc/postfix/master.cf 21 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 22 | sed -i "s/#smtps inet n - - - - smtpd/smtps inet n - - - - smtpd/" /etc/postfix/master.cf 23 | sed -i "s/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/" /etc/postfix/master.cf 24 | sed -i "s/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/" /etc/postfix/master.cf 25 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 26 | echo -e "[${green}DONE${NC}]\n" 27 | echo -n "Restarting Postfix... " 28 | service postfix restart 29 | echo -e "[${green}DONE${NC}]\n" 30 | } 31 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | apt_install quota quotatool 8 | echo -e "[${green}DONE${NC}]\n" 9 | 10 | if ! [ -f /proc/user_beancounters ]; then 11 | echo -n "Initializing Quota, this may take awhile... " 12 | if [ "$(grep -c ',usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0' /etc/fstab)" -eq 0 ]; then 13 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 14 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 15 | fi 16 | mount -o remount / 17 | quotacheck -avugm 18 | quotaon -avug 19 | echo -e "[${green}DONE${NC}]\n" 20 | fi 21 | } 22 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_webmail.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebmail 3 | # Install the chosen webmail client. Squirrelmail or Roundcube 4 | #--------------------------------------------------------------------- 5 | InstallWebmail() { 6 | echo -n "Installing Webmail client (SquirrelMail)... " 7 | echo "dictionaries-common dictionaries-common/default-wordlist select american (American English)" | debconf-set-selections 8 | apt_install squirrelmail wamerican 9 | ln -s /etc/squirrelmail/apache.conf /etc/apache2/conf-enabled/squirrelmail.conf 10 | sed -i 1d /etc/squirrelmail/apache.conf 11 | sed -i '1iAlias /webmail /usr/share/squirrelmail' /etc/squirrelmail/apache.conf 12 | 13 | case $CFG_MTA in 14 | "courier") 15 | sed -i 's/$imap_server_type = "other";/$imap_server_type = "courier";/' /etc/squirrelmail/config.php 16 | sed -i 's/$optional_delimiter = "detect";/$optional_delimiter = ".";/' /etc/squirrelmail/config.php 17 | sed -i 's/$default_folder_prefix = "";/$default_folder_prefix = "INBOX.";/' /etc/squirrelmail/config.php 18 | sed -i 's/$trash_folder = "INBOX.Trash";/$trash_folder = "Trash";/' /etc/squirrelmail/config.php 19 | sed -i 's/$sent_folder = "INBOX.Sent";/$sent_folder = "Sent";/' /etc/squirrelmail/config.php 20 | sed -i 's/$draft_folder = "INBOX.Drafts";/$draft_folder = "Drafts";/' /etc/squirrelmail/config.php 21 | sed -i 's/$default_sub_of_inbox = true;/$default_sub_of_inbox = false;/' /etc/squirrelmail/config.php 22 | sed -i 's/$delete_folder = false;/$delete_folder = true;/' /etc/squirrelmail/config.php 23 | ;; 24 | "dovecot") 25 | sed -i 's/$imap_server_type = "other";/$imap_server_type = "dovecot";/' /etc/squirrelmail/config.php 26 | sed -i 's/$trash_folder = "INBOX.Trash";/$trash_folder = "Trash";/' /etc/squirrelmail/config.php 27 | sed -i 's/$sent_folder = "INBOX.Sent";/$sent_folder = "Sent";/' /etc/squirrelmail/config.php 28 | sed -i 's/$draft_folder = "INBOX.Drafts";/$draft_folder = "Drafts";/' /etc/squirrelmail/config.php 29 | sed -i 's/$default_sub_of_inbox = true;/$default_sub_of_inbox = false;/' /etc/squirrelmail/config.php 30 | sed -i 's/$delete_folder = false;/$delete_folder = true;/' /etc/squirrelmail/config.php 31 | ;; 32 | esac 33 | mkdir /var/lib/squirrelmail/tmp 34 | chown www-data /var/lib/squirrelmail/tmp 35 | echo -e "[${green}DONE${NC}]\n" 36 | if [ "$CFG_WEBSERVER" == "apache" ]; then 37 | echo -n "Restarting Apache... " 38 | service apache2 restart 39 | elif [ "$CFG_WEBSERVER" == "nginx" ]; then 40 | echo -n "Restarting nginx... " 41 | service nginx restart 42 | fi 43 | echo -e "[${green}DONE${NC}]\n" 44 | } 45 | 46 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Vlogger, Webalizer and AWStats)... "; 7 | apt_install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl 8 | sed -i 's/^/#/' /etc/cron.d/awstats 9 | echo -e "[${green}DONE${NC}]\n" 10 | } 11 | 12 | -------------------------------------------------------------------------------- /distros/ubuntu-16.10/preinstallcheck.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: PreInstallCheck 3 | # Do some pre-install checks 4 | #--------------------------------------------------------------------- 5 | PreInstallCheck() { 6 | echo -n "Preparing to install... " 7 | # Check source.list 8 | #contrib=$(cat /etc/apt/sources.list | grep contrib | grep -v "cdrom") 9 | #nonfree=$(cat /etc/apt/sources.list | grep non-free | grep -v "cdrom") 10 | #if [ -z "$contrib" ]; then 11 | # if [ -z "$nonfree" ]; then 12 | # sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; 13 | # else 14 | # sed -i 's/main/main contrib/' /etc/apt/sources.list; 15 | # fi 16 | #else 17 | # if [ -z "$nonfree" ]; then 18 | # sed -i 's/main/main non-free/' /etc/apt/sources.list; 19 | # fi 20 | #fi 21 | echo -e "${green} OK${NC}\n" 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_antivirus.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallAntiVirus 3 | # Install Amavisd, Spamassassin, ClamAV 4 | #--------------------------------------------------------------------- 5 | InstallAntiVirus() { 6 | echo -n "Installing Antivirus utilities (Amavisd-new, ClamAV), Spam filtering (SpamAssassin), Greylisting (Postgrey) and Rootkit detection (rkhunter)... (This may take awhile. Do not abort...) " 7 | apt_install amavisd-new spamassassin clamav clamav-daemon 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 postgrey rkhunter razor pyzor libmail-dkim-perl 8 | echo -e "[${green}DONE${NC}]\n" 9 | sed -i "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/" /etc/clamav/clamd.conf 10 | echo "\$myhostname = \"$CFG_HOSTNAME_FQDN\";" >> /etc/amavis/conf.d/05-node_id 11 | echo -n "Stopping SpamAssassin... " 12 | service spamassassin stop 13 | echo -e "[${green}DONE${NC}]\n" 14 | echo -n "Disabling SpamAssassin... " 15 | hide_output update-rc.d -f spamassassin remove 16 | echo -e "[${green}DONE${NC}]\n" 17 | #Patch 18 | echo -n "Applying patch for Amavisd-new... " 19 | cd /tmp 20 | wget -q https://git.ispconfig.org/ispconfig/ispconfig3/raw/stable-3.1/helper_scripts/ubuntu-amavisd-new-2.11.patch 21 | cd /usr/sbin 22 | cp -pf amavisd-new amavisd-new_bak 23 | patch < /tmp/ubuntu-amavisd-new-2.11.patch 24 | echo -e "[${green}DONE${NC}]\n" 25 | if [ "$CFG_AVUPDATE" == "yes" ]; then 26 | echo -n "Updating Freshclam Antivirus Database. Please Wait... " 27 | freshclam 28 | echo -e "[${green}DONE${NC}]\n" 29 | fi 30 | echo -n "Restarting ClamAV... " 31 | service clamav-daemon restart 32 | echo -e "[${green}DONE${NC}]\n" 33 | } 34 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_basephp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasePhp Ubuntu 18.04 3 | # Install Basic php need to run ispconfig 4 | #--------------------------------------------------------------------- 5 | InstallBasePhp(){ 6 | echo -n "Installing basic PHP modules... " 7 | apt_install php7.2-cli php7.2-mysql mcrypt 8 | echo -e "[${green}DONE${NC}]\n" 9 | } -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_basics.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBasics 3 | # Install basic packages 4 | #--------------------------------------------------------------------- 5 | InstallBasics() { 6 | echo -n "Updating apt package database and upgrading currently installed packages... " 7 | hide_output apt-get update 8 | # hide_output apt-get -y upgrade 9 | hide_output apt-get -y dist-upgrade 10 | hide_output apt-get -y autoremove 11 | echo -e "[${green}DONE${NC}]\n" 12 | 13 | echo -n "Installing basic packages (OpenSSH server, NTP, binutils, etc.)... " 14 | # apt_install ssh openssh-server vim-nox php7.2-cli ntp ntpdate debconf-utils binutils sudo git lsb-release 15 | apt_install ssh openssh-server vim-nox php7.2-cli ntp debconf-utils binutils sudo git lsb-release 16 | echo -e "[${green}DONE${NC}]\n" 17 | echo -n "Stopping AppArmor... " 18 | service apparmor stop 19 | echo -e "[${green}DONE${NC}]\n" 20 | echo -n "Disabling AppArmor... " 21 | hide_output update-rc.d -f apparmor remove 22 | echo -e "[${green}DONE${NC}]\n" 23 | echo -n "Removing AppArmor... " 24 | apt_remove apparmor apparmor-utils 25 | echo -e "[${green}DONE${NC}]\n" 26 | 27 | if [ /bin/sh -ef /bin/dash ]; then 28 | echo -n "Changing the default shell from dash to bash... " 29 | echo "dash dash/sh boolean false" | debconf-set-selections 30 | dpkg-reconfigure -f noninteractive dash > /dev/null 2>&1 31 | echo -e "[${green}DONE${NC}]\n" 32 | fi 33 | } 34 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_bind.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallBind 3 | # Install bind DNS server 4 | #--------------------------------------------------------------------- 5 | InstallBind() { 6 | echo -n "Installing DNS server (Bind)... "; 7 | apt_install bind9 dnsutils haveged 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_fix.sh: -------------------------------------------------------------------------------- 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=$(grep "mynetworks =" /etc/postfix/main.cf | 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 | echo -n "Restarting Amavisd-new... " 14 | service amavisd-new restart 15 | else 16 | echo -n "Restarting Amavisd... " 17 | service amavis restart 18 | fi 19 | echo -e "[${green}DONE${NC}]\n" 20 | fi 21 | } 22 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_ftp.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallFTP 3 | # Install and configure PureFTPd 4 | #--------------------------------------------------------------------- 5 | InstallFTP() { 6 | echo -n "Installing FTP server (Pure-FTPd)... " 7 | echo "pure-ftpd-common pure-ftpd/virtualchroot boolean true" | debconf-set-selections 8 | apt_install pure-ftpd-common pure-ftpd-mysql 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 | echo -e "[${green}DONE${NC}]\n" 15 | echo -n "Restarting Pure-FTPd... " 16 | service openbsd-inetd restart 17 | service pure-ftpd-mysql restart 18 | echo -e "[${green}DONE${NC}]\n" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_hhvm.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallHHVM 3 | # Install HHVM 4 | #--------------------------------------------------------------------- 5 | InstallHHVM() { 6 | echo -n "Installing HHVM (Hip Hop Virtual Machine)... " 7 | apt-get -y install hhvm 8 | echo -e "[${green}DONE${NC}]\n" 9 | } 10 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_jailkit.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallJailkit 3 | # Install Jailkit 4 | #--------------------------------------------------------------------- 5 | 6 | #Program Versions 7 | JKV="2.19" #Jailkit Version -> Maybe this can be automated 8 | SUM="f46cac122ac23b1825330d588407aa96" 9 | 10 | InstallJailkit() { 11 | echo -n "Installing Jailkit... " 12 | apt_install build-essential autoconf automake libtool flex bison debhelper binutils 13 | cd /tmp 14 | wget -q https://olivier.sessink.nl/jailkit/jailkit-$JKV.tar.gz 15 | if [[ ! "$(md5sum jailkit-$JKV.tar.gz | head -c 32)" = "$SUM" ]]; then 16 | echo -e "\n${red}Error: md5sum does not match${NC}" >&2 17 | echo "Please try running this script again" >&2 18 | exit 1 19 | fi 20 | tar xfz jailkit-$JKV.tar.gz 21 | cd jailkit-$JKV 22 | echo 5 > debian/compat 23 | ./debian/rules binary > /dev/null 2>&1 24 | cd .. 25 | hide_output dpkg -i jailkit_$JKV-1_*.deb 26 | rm -rf jailkit-$JKV 27 | echo -e "[${green}DONE${NC}]\n" 28 | } 29 | 30 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_metronome.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMetronome 3 | # Install metronomeServer 4 | #--------------------------------------------------------------------- 5 | InstallMetronome() { 6 | echo -n "Installing Metronome... "; 7 | apt_install git lua5.1 liblua5.1-0-dev lua-filesystem libidn11-dev libssl-dev lua-zlib lua-expat lua-event lua-bitop lua-socket lua-sec luarocks luarocks 8 | luarocks install lpc 9 | adduser --no-create-home --disabled-login --gecos 'Metronome' metronome 10 | cd /opt; git clone https://github.com/maranda/metronome.git metronome 11 | cd ./metronome; ./configure --ostype=debian --prefix=/usr 12 | make 13 | make install 14 | cd /etc/metronome/certs && make localhost.key && make localhost.csr && make localhost.cert && chmod 0400 localhost.key && chown metronome localhost.key 15 | echo -e "[${green}DONE${NC}]\n" 16 | } 17 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_mta.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallMTA 3 | # Install chosen MTA. Courier or Dovecot 4 | #--------------------------------------------------------------------- 5 | InstallMTA() { 6 | case $CFG_MTA in 7 | "courier") 8 | echo -n "Installing POP3/IMAP Mail server (Courier) and Mail signing (OpenDKIM, OpenDMARC)... "; 9 | echo "courier-base courier-base/webadmin-configmode boolean false" | debconf-set-selections 10 | echo "courier-ssl courier-ssl/certnotice note" | debconf-set-selections 11 | echo "courier-maildrop courier-maildrop/deprecated note" | debconf-set-selections 12 | echo "courier-base courier-base/certnotice note" | debconf-set-selections 13 | echo "courier-base courier-base/courier-user note" | debconf-set-selections 14 | apt_install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql courier-maildrop opendkim opendkim-tools opendmarc 15 | sed -i 's/START=no/START=yes/' /etc/default/saslauthd 16 | cd /etc/courier 17 | rm -f /etc/courier/imapd.pem 18 | rm -f /etc/courier/pop3d.pem 19 | rm -f /usr/lib/courier/imapd.pem 20 | rm -f /usr/lib/courier/pop3d.pem 21 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/imapd.cnf 22 | sed -i "s/CN=localhost/CN=${CFG_HOSTNAME_FQDN}/" /etc/courier/pop3d.cnf 23 | mkimapdcert > /dev/null 2>&1 24 | mkpop3dcert > /dev/null 2>&1 25 | ln -s /usr/lib/courier/imapd.pem /etc/courier/imapd.pem 26 | ln -s /usr/lib/courier/pop3d.pem /etc/courier/pop3d.pem 27 | service courier-imap-ssl restart 28 | service courier-pop-ssl restart 29 | service courier-authdaemon restart 30 | service saslauthd restart 31 | echo -e "[${green}DONE${NC}]\n" 32 | ;; 33 | "dovecot") 34 | echo -n "Installing POP3/IMAP Mail server (Dovecot) and Mail signing (OpenDKIM, OpenDMARC)... "; 35 | echo "dovecot-core dovecot-core/create-ssl-cert boolean false" | debconf-set-selections 36 | echo "dovecot-core dovecot-core/ssl-cert-name string $CFG_HOSTNAME_FQDN" | debconf-set-selections 37 | apt_install dovecot-imapd dovecot-pop3d dovecot-mysql dovecot-sieve dovecot-lmtpd opendkim opendkim-tools opendmarc 38 | echo -e "[${green}DONE${NC}]\n" 39 | ;; 40 | esac 41 | } 42 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallSQLServer 3 | # Install and configure SQL Server 4 | #--------------------------------------------------------------------- 5 | InstallSQLServer() { 6 | if [ "$CFG_SQLSERVER" == "MySQL" ]; then 7 | echo -n "Installing Database server (MySQL)... " 8 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 9 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 10 | apt_install mysql-client mysql-server 11 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/my.cnf 12 | echo -e "[${green}DONE${NC}]\n" 13 | echo -n "Restarting MySQL... " 14 | service mysql restart 15 | echo -e "[${green}DONE${NC}]\n" 16 | 17 | elif [ "$CFG_SQLSERVER" == "MariaDB" ]; then 18 | 19 | echo -n "Installing Database server (MariaDB)... " 20 | echo "mysql-server-5.5 mysql-server/root_password password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 21 | echo "mysql-server-5.5 mysql-server/root_password_again password $CFG_MYSQL_ROOT_PWD" | debconf-set-selections 22 | apt_install mariadb-client mariadb-server 23 | sed -i 's/bind-address = 127.0.0.1/#bind-address = 127.0.0.1/' /etc/mysql/mariadb.conf.d/50-server.cnf 24 | echo -e "[${green}DONE${NC}]\n" 25 | echo -n "Restarting MariaDB... " 26 | service mysql restart 27 | echo -e "[${green}DONE${NC}]\n" 28 | fi 29 | } 30 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_postfix.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: Install Postfix 3 | # Install and configure postfix 4 | #--------------------------------------------------------------------- 5 | InstallPostfix() { 6 | if [ -f /etc/init.d/sendmail ]; then 7 | echo -n "Removing Sendmail... " 8 | service sendmail stop 9 | hide_output update-rc.d -f sendmail remove 10 | apt_remove sendmail 11 | echo -e "[${green}DONE${NC}]\n" 12 | fi 13 | 14 | echo -n "Installing SMTP Mail server (Postfix)... " 15 | echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections 16 | echo "postfix postfix/mailname string $CFG_HOSTNAME_FQDN" | debconf-set-selections 17 | apt_install postfix postfix-mysql postfix-doc getmail4 18 | sed -i "s/#submission inet n - - - - smtpd/submission inet n - - - - smtpd/" /etc/postfix/master.cf 19 | sed -i "s/# -o syslog_name=postfix\/submission/ -o syslog_name=postfix\/submission/" /etc/postfix/master.cf 20 | sed -i "s/# -o smtpd_tls_security_level=encrypt/ -o smtpd_tls_security_level=encrypt/" /etc/postfix/master.cf 21 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 22 | sed -i "s/#smtps inet n - - - - smtpd/smtps inet n - - - - smtpd/" /etc/postfix/master.cf 23 | sed -i "s/# -o syslog_name=postfix\/smtps/ -o syslog_name=postfix\/smtps/" /etc/postfix/master.cf 24 | sed -i "s/# -o smtpd_tls_wrappermode=yes/ -o smtpd_tls_wrappermode=yes/" /etc/postfix/master.cf 25 | sed -i "s/# -o smtpd_sasl_auth_enable=yes/ -o smtpd_sasl_auth_enable=yes\\$(echo -e '\n\r') -o smtpd_client_restrictions=permit_sasl_authenticated,reject/" /etc/postfix/master.cf 26 | echo -e "[${green}DONE${NC}]\n" 27 | echo -n "Restarting Postfix... " 28 | service postfix restart 29 | echo -e "[${green}DONE${NC}]\n" 30 | } 31 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_quota.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallQuota 3 | # Install and configure of disk quota 4 | #--------------------------------------------------------------------- 5 | InstallQuota() { 6 | echo -n "Installing Quota... " 7 | apt_install quota quotatool 8 | echo -e "[${green}DONE${NC}]\n" 9 | 10 | if ! [ -f /proc/user_beancounters ]; then 11 | echo -n "Initializing Quota, this may take awhile... " 12 | if [ "$(grep -c ',usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0' /etc/fstab)" -eq 0 ]; then 13 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/errors=remount-ro/errors=remount-ro,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 14 | sed -i '/\/[[:space:]]\+/ {/tmpfs/!s/defaults/defaults,usrjquota=quota.user,grpjquota=quota.group,jqfmt=vfsv0/}' /etc/fstab 15 | fi 16 | mount -o remount / 17 | quotacheck -avugm 18 | quotaon -avug 19 | echo -e "[${green}DONE${NC}]\n" 20 | fi 21 | } 22 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/install_webstats.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: InstallWebStats 3 | # Install and configure web stats 4 | #--------------------------------------------------------------------- 5 | InstallWebStats() { 6 | echo -n "Installing Statistics (Vlogger, Webalizer and AWStats)... "; 7 | apt_install vlogger webalizer awstats geoip-database libclass-dbi-mysql-perl 8 | sed -i 's/^/#/' /etc/cron.d/awstats 9 | echo -e "[${green}DONE${NC}]\n" 10 | } 11 | 12 | -------------------------------------------------------------------------------- /distros/ubuntu-18.04/preinstallcheck.sh: -------------------------------------------------------------------------------- 1 | #--------------------------------------------------------------------- 2 | # Function: PreInstallCheck 3 | # Do some pre-install checks 4 | #--------------------------------------------------------------------- 5 | PreInstallCheck() { 6 | echo -n "Preparing to install... " 7 | # Check source.list 8 | sed -i 's/main/main restricted universe multiverse/' /etc/apt/sources.list; 9 | echo "deb http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list; 10 | #contrib=$(cat /etc/apt/sources.list | grep contrib | grep -v "cdrom") 11 | #nonfree=$(cat /etc/apt/sources.list | grep non-free | grep -v "cdrom") 12 | #if [ -z "$contrib" ]; then 13 | # if [ -z "$nonfree" ]; then 14 | # sed -i 's/main/main contrib non-free/' /etc/apt/sources.list; 15 | # else 16 | # sed -i 's/main/main contrib/' /etc/apt/sources.list; 17 | # fi 18 | #else 19 | # if [ -z "$nonfree" ]; then 20 | # sed -i 's/main/main non-free/' /etc/apt/sources.list; 21 | # fi 22 | #fi 23 | echo -e "[${green}DONE${NC}]\n" 24 | } 25 | 26 | 27 | --------------------------------------------------------------------------------