#!/bin/bash echo 'Instalación IdP de referencia, v. 1.0' echo '' echo '· SimpleSAMLphp v. 1.14.14' echo '· module IdP installer v. 1.0.13' echo '· module sir2skin v. 1.0.14' echo '· module hub&spoke (dev-master)' echo '' set -e echo 'Descargando Composer...' curl -sS https://getcomposer.org/installer | php > /dev/null 2>&1 echo '' #echo 'Descargando elementos que utilizará el instalador...' #curl -sS http://www.rediris.es/sir2/IdP/install/theme-sir2.zip -o theme-sir2.zip echo '' echo 'Instalando SimpleSAMLphp...' php composer.phar require simplesamlphp/simplesamlphp:1.14.14 --update-no-dev mv vendor/simplesamlphp/simplesamlphp simplesamlphp rm -rf vendor rm composer.json rm composer.lock mv composer.phar simplesamlphp/ cd simplesamlphp php composer.phar update --no-dev echo '' echo 'Descargando y activando módulo de configuración del IdP de referencia...' mkdir cert chmod -R g+w cert cp -pr metadata-templates/saml20* metadata/ cp -pr config-templates/* config/ chmod g+w metadata/saml20-idp-hosted.php chmod g+w metadata/saml20-sp-remote.php php composer.phar require --update-no-dev rediris-es/simplesamlphp-module-idpinstaller:1.0.13 chmod -R g+w modules find . -name makeCert.sh -exec chmod ug+x {} \; echo '' echo 'Descargando y activando módulo de cálculo de eduPersonTargetedId' php composer.phar require mimaen/simplesamlphp-module-hubandspoke:dev-master if [ -f modules/hubandspoke/default-disable ]; then mv modules/hubandspoke/default-disable modules/hubandspoke/default-enable fi echo '' echo 'Descargando configuración preliminar y aplicando tema básico' #rm -f www/resources/icons/ssplogo-fish-small.png php composer.phar require rediris-es/simplesamlphp-module-sir2skin:v1.0.14 --update-no-dev touch modules/sir2skin/default-enable curl -sS http://www.rediris.es/sir2/IdP/install/config.php.txt -o config/config.php chmod g+w config/config.php if [ -f modules/sir2skin/default.disable ]; then mv modules/sir2skin/default.disable modules/sir2skin/default-enable fi echo '' echo 'Determinando usuario y grupo del servidor web' export APACHE_PROCESS="`ps axo user,group,fname | grep apache | grep -v root | uniq`" export APACHE_USER="`echo ${APACHE_PROCESS} | cut -d ' ' -f 1`" export APACHE_GROUP="`echo ${APACHE_PROCESS} | cut -d ' ' -f 2`" echo '' echo 'Cambiado usuario y grupo del servidor web a '$APACHE_USER' y grupo '$APACHE_GROUP chmod a+x cert chown -R $APACHE_USER\:$APACHE_GROUP . echo '' echo -e 'Ejemplo de configuración del servidor web:' cat << FIN 8<.... # Ejemplo de configuración del host virtual con simplesamlphp en el directorio raíz ServerName `hostname -f` DocumentRoot `pwd`/www Alias / `pwd`/www/ CustomLog /var/log/httpd/`hostname -f`-access.log combined ErrorLog /var/log/httpd/`hostname -f`-error.log Options -Indexes +FollowSymLinks AllowOverride None Order deny,allow Allow from all Options FollowSymLinks AllowOverride None Order deny,allow Allow from all ...>8 FIN echo '¡Todo hecho!' echo '' echo 'Una vez configurado el servidor web, deberías poder acceder al módulo de instalación del IdP,' echo 'en una dirección como: http://'`hostname -f`'/module.php/idpinstaller/ ' echo '' echo 'Sigue los pasos de dicho instalador, y al final tendrás tu IdP preconfigurado con lo más importante.'