Skip to content

Commit

Permalink
Merge pull request #189 from rsiddall/master
Browse files Browse the repository at this point in the history
Fixes for CentOS 7 support (and a few typos)
  • Loading branch information
servisys authored May 16, 2017
2 parents 17009dc + 8652764 commit 1ec86eb
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 17 deletions.
9 changes: 9 additions & 0 deletions distros/centos7/askquestions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ AskQuestions() {
CFG_DKIM=n
fi

if (whiptail --title "Mailman" --backtitle "$WT_BACKTITLE" --yesno "Would you like to install Mailman?" 10 50) then
CFG_MAILMAN=y
MMSITEPASS=$(whiptail --title "Mailman Site Password" --backtitle "$WT_BACKTITLE" --inputbox "Please specify the Mailman site password" --nocancel 10 50 3>&1 1>&2 2>&3)
MMISTOWNER=$(whiptail --title "Mailman Site List Owner" --backtitle "$WT_BACKTITLE" --inputbox "Please specify the Mailman site list owner" --nocancel 10 50 3>&1 1>&2 2>&3)
MMLISTPASS=$(whiptail --title "Mailman Site List Password" --backtitle "$WT_BACKTITLE" --inputbox "Please specify the Mailman site list password" --nocancel 10 50 3>&1 1>&2 2>&3)
else
CFG_MAILMAN=n
fi

while [ "x$CFG_WEBMAIL" == "x" ]
do
CFG_WEBMAIL=$(whiptail --title "Webmail client" --backtitle "$WT_BACKTITLE" --nocancel --radiolist "Select your webmail client" 10 50 2 "roundcube" "(default)" ON "squirrelmail" "" OFF 3>&1 1>&2 2>&3)
Expand Down
2 changes: 1 addition & 1 deletion distros/centos7/install_antivirus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#---------------------------------------------------------------------
InstallAntiVirus() {
echo -n "Installing Anti-Virus utilities... "
yum -y install amavisd-new spamassassin clamav clamd clamav-update unzip bzip2 unrar perl-DBD-mysql > /dev/null 2>&1
yum -y install amavisd-new spamassassin clamav clamav-server clamav-server-systemd clamav-data-empty clamav-update postgrey unzip bzip2 unrar perl-DBD-mysql > /dev/null 2>&1
sed -i "s/Example/#Example/" /etc/freshclam.conf
sa-update
freshclam
Expand Down
3 changes: 1 addition & 2 deletions distros/centos7/install_basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ InstallBasics() {
echo -e "${green}done${NC}"

echo -n "Installing basic packages... "
yum -y install nano wget net-tools NetworkManager-tui
yum -y install nano wget net-tools NetworkManager-tui selinux-policy deltarpm epel-release
echo -e "${green}done${NC}"

echo -n "Disabling Firewall... "
Expand All @@ -22,7 +22,6 @@ InstallBasics() {

echo -n "Enabling additional Repository..."
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
yum -y install yum-priorities
sed -i "s/mirrorlist=https:\\/\\/mirrors.fedoraproject.org\\/metalink?repo=epel-7\\&arch=\$basearch/mirrorlist=https:\\/\\/mirrors.fedoraproject.org\\/metalink?repo=epel-7\\&arch=\$basearch\\`echo \n`priority=10/" /etc/yum.repos.d/epel.repo
yum update
Expand Down
2 changes: 1 addition & 1 deletion distros/centos7/install_bind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#---------------------------------------------------------------------
InstallBind() {
echo -n "Installing bind... ";
yum -y install bind bind-utils > /dev/null 2>&1
yum -y install bind bind-utils haveged > /dev/null 2>&1
cp /etc/named.conf /etc/named.conf_bak
echo "options {" > /etc/named.conf
echo " listen-on port 53 { any; };" >> /etc/named.conf
Expand Down
2 changes: 1 addition & 1 deletion distros/centos7/install_jailkit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#---------------------------------------------------------------------

#Program Versions
JKV="2.17" #Jailkit Version -> Maybe this can be automated
JKV="2.19" #Jailkit Version -> Maybe this can be automated

InstallJailkit() {
echo -n "Installing Jailkit... "
Expand Down
15 changes: 15 additions & 0 deletions distros/centos7/install_mailman.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#---------------------------------------------------------------------
# Function: InstallMailman
# Install the Mailman list manager
#---------------------------------------------------------------------
InstallMailman() {
echo -n "Installing mailman... ";
yum -y install mailman > /dev/null 2>&1
/usr/lib/mailman/bin/mmsitepass ${MMSITEPASS}
/usr/lib/mailman/bin/newlist -q mailman ${MMLISTOWNER} ${MMLISTPASS} | grep '/usr/lib' >> /etc/mailman/aliases
postalias /etc/mailman/aliases
systemctl restart postfix > /dev/null 2>&1
systemctl enable mailman > /dev/null 2>&1
systemctl start mailman > /dev/null 2>&1
echo -e "${green}done! ${NC}\n"
}
18 changes: 18 additions & 0 deletions distros/centos7/install_metronom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#---------------------------------------------------------------------
# Function: InstallMetronom
# Install Metronom Server
#---------------------------------------------------------------------
InstallMetronom() {
echo -n "Installing Metronome...";
yum -y install git lua lua-devel lua-filesystem libidn-devel openssl-devel lua-bitop lua-socket lua-sec luarocks
luarocks install lpc
adduser --no-create-home --shell /sbin/nologin --comment 'Metronome' metronome
cd /opt; git clone https://github.com/maranda/metronome.git metronome
cd ./metronome; ./configure --ostype=centos --prefix=/usr
make
make install
pushd /etc/metronome/certs && make localhost.key && make localhost.csr && make localhost.cert && chmod 0400 localhost.key && chown metronome localhost.key
popd
/bin/rm -rf metronome
echo -e "[${green}DONE${NC}]\n"
}
5 changes: 4 additions & 1 deletion distros/centos7/install_postfix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Install and configure postfix
#---------------------------------------------------------------------
InstallPostfix() {
echo -e "Cheking and disabling sendmail...\n"
echo -e "Checking and disabling sendmail...\n"
systemctl stop sendmail.service > /dev/null 2>&1
systemctl disable sendmail.service > /dev/null 2>&1
echo -e "Installing postfix... \n"
Expand All @@ -12,6 +12,9 @@ InstallPostfix() {
mkdir /etc/mailman/
touch /etc/mailman/virtual-mailman
postmap /etc/mailman/virtual-mailman
if [ "$CFG_MAILMAN" == "yes" ]; then
InstallMailman
fi
systemctl enable postfix.service > /dev/null 2>&1
systemctl restart postfix.service > /dev/null 2>&1
echo -e "${green}done${NC}\n"
Expand Down
1 change: 1 addition & 0 deletions distros/centos7/install_webmail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ InstallWebmail() {
mysql -u root -p$CFG_MYSQL_ROOT_PWD -e 'FLUSH PRIVILEGES;'
cat /etc/roundcubemail/config.inc.php.sample | grep -v db_dsnw > /etc/roundcubemail/config.inc.php
sed -i "s/$config = array();/\$config = array();\\`echo \n`$config[\\'db_dsnw\\'] = \\'mysql:\/\/$ROUNDCUBE_USER:$ROUNDCUBE_PWD@localhost\/$ROUNDCUBE_DB\\';/" /etc/roundcubemail/config.inc.php
mysql -u $ROUNDCUBE_USER -p$ROUNDCUBE_PWD $ROUNDCUBE_DB < /usr/share/roundcubemail/SQL/mysql.initial.sql
if [ $CFG_WEBSERVER == "apache" ]; then
echo "Alias /roundcubemail /usr/share/roundcubemail" > /etc/httpd/conf.d/roundcubemail.conf
echo "Alias /webmail /usr/share/roundcubemail" >> /etc/httpd/conf.d/roundcubemail.conf
Expand Down
9 changes: 6 additions & 3 deletions distros/centos7/install_webserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,18 @@ InstallWebServer() {
sed -i "s/Require ip 127.0.0.1/#Require ip 127.0.0.1/" /etc/httpd/conf.d/phpMyAdmin.conf
sed -i '0,/Require ip ::1/ s/Require ip ::1/#Require ip ::1\n Require all granted/' /etc/httpd/conf.d/phpMyAdmin.conf
sed -i "s/'cookie'/'http'/" /etc/phpMyAdmin/config.inc.php
echo "Installing Let's Encrypt... "
yum -y install letsencrypt > /dev/null 2>&1
echo -e "${green}done!${NC}\n"
systemctl enable httpd.service
systemctl restart httpd.service
echo -e "${green}done! ${NC}\n"
else
echo "Sorry Nginx not implemented Yet"
read DUMMY
fi

echo -e "${green}done! ${NC}\n"

echo -n "Installing Let's Encrypt... "
yum -y install certbot

echo -e "${green}done! ${NC}\n"
}
2 changes: 1 addition & 1 deletion distros/centos7/install_webstats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#---------------------------------------------------------------------
InstallWebStats() {
echo -n "Installing stats... ";
yum -y install webalizer awstats perl-DateTime-Format-HTTP perl-DateTime-Format-Builder > /dev/null 2>&1
yum -y install awstats perl-DateTime-Format-HTTP perl-DateTime-Format-Builder > /dev/null 2>&1
echo -e "${green}done! ${NC}\n"
}

2 changes: 1 addition & 1 deletion distros/debian7/install_postfix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#---------------------------------------------------------------------
InstallPostfix() {
echo -e "Installing postfix... \n"
echo -e "Cheking and disabling sendmail...\n"
echo -e "Checking and disabling sendmail...\n"
if [ -f /etc/init.d/sendmail ]; then
service sendmail stop
update-rc.d -f sendmail remove
Expand Down
15 changes: 9 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ clear
echo "Welcome to ISPConfig Setup Script v.2.2.4"
echo "This software is developed by Temporini Matteo"
echo "with the support of the community."
echo "You can visit my website at the followings URLS"
echo "You can visit my website at the followings URLs"
echo "http://www.servisys.it http://www.temporini.net"
echo "and contact me with the following information"
echo "contact email/hangout: [email protected]"
Expand Down Expand Up @@ -190,11 +190,11 @@ if [ -f /etc/debian_version ]; then
fi
else
if [ -f /etc/centos-release ]; then
echo "Attention pls, this is the very first version of the script for Centos 7"
echo "Pls use only for test pourpose for now."
echo "Attention please, this is the very first version of the script for CentOS 7"
echo "Please use only for test purpose for now."
echo -e "${red}Not yet implemented: courier, nginx support${NC}"
echo -e "${green}Yet implemented: apache, mysql, bind, postfix, dovecot, roudcube webmail support${NC}"
echo "Help us to test and implement, press ENTER if you understand what i'm talinkg about..."
echo -e "${green}Implemented: apache, mysql, bind, postfix, dovecot, roudcube webmail support${NC}"
echo "Help us to test and implement, press ENTER if you understand what I'm talking about..."
read DUMMY
PreInstallCheck
AskQuestions
Expand All @@ -214,10 +214,13 @@ else
InstallJailkit
fi
InstallFail2ban
if [ "$CFG_METRONOM" == "yes" ]; then
InstallMetronom
fi
InstallWebmail
InstallISPConfig
#InstallFix
echo -e "${green}Well done ISPConfig installed and configured correctly :D ${NC}"
echo -e "${green}Well done! ISPConfig installed and configured correctly :D ${NC}"
echo "Now you can connect to your ISPConfig installation at https://$CFG_HOSTNAME_FQDN:8080 or https://IP_ADDRESS:8080"
echo "You can visit my GitHub profile at https://github.com/servisys/ispconfig_setup/"
echo -e "${red}If you setup Roundcube webmail go to http://$CFG_HOSTNAME_FQDN/roundcubemail/installer and configure db connection${NC}"
Expand Down

0 comments on commit 1ec86eb

Please sign in to comment.