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://my.oschina.net/csq/blog/1486720

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值