Dies ist eine alte Version des Dokuments!


yum install httpd mod_ssl

Da Apache als Frontend vor Tomcat 7.0 via AJP verwendet wird: in /etc/sysconfig/apache2 muss bei APACHE_MODULES proxy vor proxy_ajp stehen (ggfs. so editieren), weiterhin APACHE_SERVER_FLAGS=„SSL“ setzen.

root@idp:~# apt-get install apache2

Für einen sicheren Betrieb werden weiterhin einige Module benötigt, die nicht in allen Fällen per default aktiv sind:

root@idp:~# a2enmod ssl
root@idp:~# a2enmod headers
root@idp:~# a2enmod proxy_ajp

Abschließend muss der Web Server neu gestartet werden

root@idp:~# systemctl restart apache2
/etc/apache2/sites-enabled/idp.uni-beispiel.de.conf
################################################
#
# Bitte im Folgenden 'IDP-IP-ADRESSE' und ggf. 'IDP-IPv6-ADRESSE'
# jeweils durch die entsprechende IP und 'idp.uni-beispiel.de' durch 
# den FQDN Ihres IdPs ersetzen!
#
# Die Angabe der Portnummer bei 'ServerName' ist wichtig falls
# für den SSO auf Port 443 ein anderes Zertifikat verwendet werden
# soll als für die Attribute Authority auf Port 8443
#
#
# SingleSignOnService
#
# https://idp.uni-beispiel.de/idp/profile/SAML2/POST/SSO
# https://idp.uni-beispiel.de/idp/profile/SAML2/Redirect/SSO
# https://idp.uni-beispiel.de/idp/profile/Shibboleth/SSO
#
# Sofern der Port 443 nicht von der Distribution angeschaltet wird
# (bei Debian in /etc/apache2/ports.conf, bei openSUSE in /etc/apache2/listen.conf)
# können Sie das hier manuell machen:
#
# Listen 443
#
 
################################################
#
# SingleSignOnService auf Port 443
#
<VirtualHost IDP-IP-ADRESSE:443 [IDP-IPv6-ADRESSE]:443>
  ServerName              idp.uni-beispiel.de
 
  SSLEngine on
  SSLCertificateFile      /etc/ssl/localcerts/idp.uni-beispiel.crt.pem
  SSLCertificateKeyFile   /etc/ssl/private/idp.uni-beispiel.key.pem
  SSLCACertificateFile    /etc/ssl/chains/uni-beispiel-chain.pem
 
  AddDefaultCharset UTF-8
 
  <Location /idp>
    Require all granted
    ProxyPass ajp://localhost:8009/idp
    # "SAMEORIGIN" vermeidet etwaige Fehlermeldungen
    # im Browser beim Logout über mehrere SPs, 
    # da hierbei mit iframes gearbeitet wird
    Header always append X-FRAME-OPTIONS "SAMEORIGIN"
  </Location>
 
</VirtualHost>
 
################################################
#
# ArtifactResolutionService und AttributeService
#
# https://idp.beispiel-uni.de:8443/idp/profile/SAML2/SOAP/ArtifactResolution
# https://idp.beispiel-uni.de:8443/idp/profile/SAML1/SOAP/ArtifactResolution
#
# https://idp.beispiel-uni.de:8443/idp/profile/SAML2/SOAP/AttributeQuery
# https://idp.beispiel-uni.de:8443/idp/profile/SAML1/SOAP/AttributeQuery
#
Listen IDP-IP-ADRESSE:8443
Listen [IDP-IPv6-ADRESSE]:8443
 
<VirtualHost IDP-IP-ADRESSE:8443 [IDP-IPv6-ADRESSE]:8443>
  ServerName              idp.uni-beispiel.de
 
  SSLEngine on
  SSLCertificateFile      /etc/ssl/localcerts/idp.uni-beispiel.crt.pem
  SSLCertificateKeyFile   /etc/ssl/private/idp.uni-beispiel.key.pem
  SSLCACertificateFile    /etc/ssl/chains/uni-beispiel-chain.pem
 
  # hier muss wegen veralteten SP-Clients (z.B. Thomson Reuters)
  # eine etwas weniger strikte Konfiguration genommen werden
  # als von bettercrypto.org empfohlen wird:
  SSLCipherSuite 'EECDH+ECDSA+AESGCM+AES128:AES128:EECDH+ECDSA+AESGCM+AES256:AES256:!aNULL:!eNULL:!PSK:!SRP:!DH'
 
  # Diese drei SSL-Optionen sind zwingend notwendig
  # damit SP-Abfragen auf diesen Port funktionieren!
  # Details siehe Shibboleth-Wiki
  SSLVerifyClient       optional_no_ca
  SSLVerifyDepth        10
  SSLOptions            +StdEnvVars +ExportCertData
 
  <Location /idp>
    Require all granted
    ProxyPass ajp://localhost:8009/idp
  </Location>
 
</VirtualHost>

Nach jeder Änderung die Konfiguration des HTTP Servers neu laden:

root@idp:~# service apache2 reload

Lassen Sie beim Reload des Apache den Apache-Error-Log in einem zweiten Fenster mitlaufen um etwaige Fehler oder Warnings sehen zu können:

root@idp:~# tail -f /var/log/apache2/error_log

Wenn dort keine Fehler zu sehen sind testen Sie bitte die Weiterleitung von Apache auf den Tomcat indem Sie die URL

https://HOSTNAME/idp/

aufrufen.

Es sollte dann eine Tomcat-Fehlermeldung zu sehen sein da das IdP-Servlet im Tomcat noch nicht aktiv ist. Kommt eine Apache-Fehlermeldung (diese sollte dann auch im obigen Apache-Log erscheinen) dann stimmt die Apache-Configuration noch nicht!

Anmerkungen:

Beispiel für eine Minimal-Konfiguration unter Windows (bereitgestellt von Thomas Glatzer, Uni Mainz):

conf/httpd.conf
#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
 
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used.  If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
ServerRoot "C:/Program Files/Apache/Apache24"
 
 
#
# Dynamic Shared Object (DSO) Support
#
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_core_module modules/mod_authz_core.so
 
LoadModule headers_module modules/mod_headers.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
 
LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_http_module modules/mod_proxy_ajp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
 
LoadModule ssl_module modules/mod_ssl.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
 
# 'Main' server configuration
ServerAdmin glatzert@uni-mainz.de
ServerName shib.uni-mainz.de
 
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other 
# <Directory> blocks below.
#
<Directory />
    AllowOverride none
    Require all denied
</Directory>
 
DocumentRoot "c:/inetpub/shib.uni-mainz.de"
<Directory "c:/inetpub/shib.uni-mainz.de">
    Options None
 
    AllowOverride None
    Require all granted
</Directory>
 
<Files ".ht*">
    Require all denied
</Files>
 
ErrorLog "C:/inetpub/logs/apache/error.log"
TransferLog "C:/inetpub/logs/apache/access.log"
LogLevel warn
 
<IfModule mime_module>
    TypesConfig conf/mime.types
 
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
</IfModule>
 
Include conf/extra/httpd-ssl.conf
Include conf/extra/shib-sp.conf
Include conf/extra/shib-idp.conf
conf/extra/httpd-ssl.conf
##
##  SSL Global Context
##
##  All SSL configuration in this context applies both to
##  the main server and all SSL-enabled virtual hosts.
##
 
#
#   Some MIME-types for downloading Certificates and CRLs
#
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl
 
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
 
SSLProtocol All -SSLv3
SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:ECDH+3DES:DH+3DES:RSA+3DES:!aNULL:!eNULL:!LOW:!RC4:!MD5:!EXP:!PSK:!DSS:!SEED:!ECDSA:!CAMELLIA
SSLHonorCipherOrder On
 
SSLUseStapling off
SSLStaplingCache "shmcb:c:/inetpub/logs/apache/ssl_stapling(512000)"
SSLStaplingReturnResponderErrors off
 
SSLSessionCache "shmcb:c:/inetpub/logs/apache/ssl_scache(512000)"
SSLSessionCacheTimeout  300
 
SSLCertificateFile "C:/inetpub/shibboleth/idp/credentials/shib.uni-mainz.de.crt"
SSLCertificateKeyFile "C:/inetpub/shibboleth/idp/credentials/shib.uni-mainz.de.key"
conf/extra/shib-idp.conf
################################################
#
# SingleSignOnService
#
 
Listen 443
 
<VirtualHost _default_:443>
  DocumentRoot "C:/inetpub/shib.uni-mainz.de"
  ServerAdmin glatzert@uni-mainz.de
 
  SSLEngine on
  Header add Strict-Transport-Security "max-age=15768000"
 
  <Proxy http://localhost:8080/idp/*>
    Require all granted
  </Proxy>
  ProxyPass /idp/ http://localhost:8080/idp/
</VirtualHost>
 
################################################
#
# ArtifactResolutionService und AttributeService
#
 
Listen 8443
 
<VirtualHost _default_:8443>
  DocumentRoot "C:/inetpub/shib.uni-mainz.de"
  ServerAdmin glatzert@uni-mainz.de
 
  SSLEngine on
  Header add Strict-Transport-Security "max-age=15768000"
 
  <Proxy http://localhost:8080/idp/*>
    Require all granted
  </Proxy>
  ProxyPass /idp/ http://localhost:8080/idp/
</VirtualHost>
conf/extra/shib-sp.conf
# https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPApacheConfig
 
LoadModule mod_shib C:/inetpub/shibboleth/sp/lib64/shibboleth/mod_shib_24.so
 
<Location /Shibboleth.sso>
  AuthType None
  Require all granted
</Location>
 
<LocationMatch "(/idp/(.*)/SSO)|(/idp/Authn)">
  AuthType shibboleth
  ShibRequestSetting requireSession 1
  Require shibboleth
</LocationMatch>
  • Zuletzt geändert: vor 7 Jahren