#!/bin/bash if [ -z $1 ] then echo "ERROR: FQDN Service Provider Needed" echo "EXAMPLE: ./install.sh sptest.unitest.it" echo "" exit; fi if [ $0 = './install.sh' ] then export HOME_INSTALL=`pwd` else export HOME_INSTALL=`dirname $0` fi #export $HOME_INSTALL export SHIB_HOME=/opt/shibboleth-sp-2.4.3 export MYBUILD=/opt/shibsp2.4.3-build mkdir $SHIB_HOME mkdir $MYBUILD mkdir /etc/shibboleth/ read -p "Press Enter to install ntp ..." apt-get -y install ntp read -p "Press Enter to install gcc g++ make ..." apt-get -y install gcc g++ make read -p "Press Enter to install apache2 openssl ..." apt-get -y install apache2 apt-get -y install openssl read -p "Press Enter to install libssl0.9.8 libssl-dev ..." apt-get -y install libssl0.9.8 libssl-dev read -p "Press Enter to install libcurl3 libcurl3-dev ..." apt-get -y install libcurl3 libcurl3-dev read -p "Press Enter to install libxerces-c3.1 libxerces-c-dev ..." apt-get -y install libxerces-c3.1 libxerces-c-dev read -p "Press Enter to install apache2-threaded-dev ..." apt-get -y install apache2-threaded-dev echo "Donwload Time" echo "wget required" read -p "Press Enter to download ..." wget http://www.shibboleth.net/downloads/log4shib/1.0.4/log4shib-1.0.4.tar.gz -P $MYBUILD wget http://www.shibboleth.net/downloads/c++-opensaml/2.4.3/xmltooling-1.4.2.tar.gz -P $MYBUILD wget http://www.shibboleth.net/downloads/c++-opensaml/2.4.3/opensaml-2.4.3.tar.gz -P $MYBUILD wget http://www.shibboleth.net/downloads/service-provider/latest/shibboleth-sp-2.4.3.tar.gz -P $MYBUILD wget http://mirror.switch.ch/mirror/apache/dist/santuario/c-library/xml-security-c-1.6.1.tar.gz -P $MYBUILD for f in $MYBUILD/*.tar.gz; do tar -xzvf $f -C $MYBUILD; done echo "Compiling Time" read -p "Press Enter to install log4shib ..." cd $MYBUILD/log4shib-1.0.4/ ./configure --prefix=$SHIB_HOME --disable-static --disable-doxygen make make install read -p "Press Enter to install xml-security-c-1.6.1 ..." cd $MYBUILD/xml-security-c-1.6.1/ ./configure --prefix=$SHIB_HOME make make install read -p "Press Enter to install xmltooling-1.4.2 ..." cd $MYBUILD/xmltooling-1.4.2/ ./configure --prefix=$SHIB_HOME --with-log4shib=$SHIB_HOME --with-xmlsec=$SHIB_HOME -C make make install read -p "Press Enter to install opensaml-2.4.3 ..." cd $MYBUILD/opensaml-2.4.3/ ./configure --prefix=$SHIB_HOME --with-log4shib=$SHIB_HOME -C make make install read -p "Press Enter to install shibboleth-2.4.3 ..." cd $MYBUILD/shibboleth-2.4.3/ ./configure --prefix=$SHIB_HOME --enable-apache-22 --with-log4shib=$SHIB_HOME --with-xmltooling=$SHIB_HOME --with-saml=$SHIB_HOME -C make make install ln -s /opt/shibboleth-sp-2.4.3/ /opt/shibboleth-sp cp /$HOME_INSTALL/configs/shibd /etc/init.d/ chmod +x /etc/init.d/shibd update-rc.d shibd defaults cp $SHIB_HOME/etc/shibboleth/protocols.xml /etc/shibboleth/ cp $SHIB_HOME/etc/shibboleth/security-policy.xml /etc/shibboleth/ cp $SHIB_HOME/etc/shibboleth/native.logger /etc/shibboleth/ cp $SHIB_HOME/etc/shibboleth/shibd.logger /etc/shibboleth/ cp $SHIB_HOME/etc/shibboleth/syslog.logger /etc/shibboleth/ mkdir -p /var/log/shibboleth/ touch /var/log/shibboleth/shibd.log touch /var/log/shibboleth/native.log chgrp www-data /var/log/shibboleth/native.log chmod g+w /var/log/shibboleth/native.log cd /etc/shibboleth/ echo "Certificate Creation Time" read -p "Press Enter to continue ..." sh $SHIB_HOME/etc/shibboleth/keygen.sh -h $1 -y 3 -e https://$1/shibboleth #cp $HOME_INSTALL/configs/native.logger /etc/shibboleth/ #cp $HOME_INSTALL/configs/shibd.logger /etc/shibboleth/ /etc/init.d/apache2 stop echo "Copying Configs Time ...." read -p "Press Enter to continue ...." cp $HOME_INSTALL/configs/shib.load /etc/apache2/mods-available/ cp $HOME_INSTALL/configs/shib.conf /etc/apache2/mods-available/ cp $HOME_INSTALL/configs/envvars /etc/apache2/ a2enmod shib mv /etc/apache2/sites-available/default-ssl /etc/apache2/sites-available/default-ssl.BAK cp $HOME_INSTALL/configs/default-ssl /etc/apache2/sites-available a2ensite default-ssl a2enmod ssl echo "++++++++ ATTENTION +++++++++" echo "" echo "" echo "Before restarting Apache make sure you have a shibboleth2.xml in /etc/shibboleth" echo "" echo "" echo ""