ubuntu14.04安装Shibboleth sp

前端之家收集整理的这篇文章主要介绍了ubuntu14.04安装Shibboleth sp前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

ubuntu14.04安装Shibboleth sp

系统环境

ubuntu14.04(分配ip为10.0.5.14)

Apache2

Shibboleth 3.2.1

安装Apache

sudo apt-get install apache2

sudo a2enmod ssl // 添加ssl模块

sudo a2ensite default-ssl.conf // 添加web service添加ssl

自定义安全证书

sudo mkdir /etc/apache2/ssl

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

添加Shibboleth web应用

sudo mkdir /var/www/myservice

sudo vi /var/www/myservice/index.html // 创建web应用首页,随便输入内容,认证成功后将会显示内容,例如:“Shibboleth protected service”

安装Shibboleth模块

sudo apt-get install libapache2-mod-shib2

sudo a2enmod auth_basic

sudo a2enmod shib2

设置Shibboleth证书

sudo shib-keygen -h localhost

测试证书

openssl x509 -text -noout -in /etc/shibboleth/sp-cert.pem

配置Shibboleth web应用

vi /etc/apache2/sites-available/default-ssl.conf

<IfModule mod_ssl.c>
        <VirtualHost _default_:443>
                ServerAdmin webmaster@localhost
				DocumentRoot /var/www
				ErrorLog ${APACHE_LOG_DIR}/error.log
				CustomLog ${APACHE_LOG_DIR}/access.log combined
				SSLEngine on
				SSLCertificateFile      /etc/apache2/ssl/apache.crt
				SSLCertificateKeyFile /etc/apache2/ssl/apache.key
				
				<FilesMatch "\.(cgi|shtml|phtml|PHP)$">
				        SSLOptions +StdEnvVars
				</FilesMatch>
				<Directory /usr/lib/cgi-bin>
				        SSLOptions +StdEnvVars
				</Directory>
				
				Alias /myservice/ /var/www/myservice/

				<Location /myservice/>
				      AuthType shibboleth
				      ShibRequestSetting requireSession 1
				      Require valid-user
				</Location>
        </VirtualHost>
</IfModule>

启动Shibboleth服务

sudo service shibd start

通过https://www.testshib.org 测试sp环境搭建情况(idp服务)

编辑shibboleth2.xml配置文件

原文链接:https://www.f2er.com/ubuntu/352012.html

猜你在找的Ubuntu相关文章