后续IdP安装脚本会使用主机名作为IdP域名,建议将主机名称与IdP域名保持一致。
[root@www ~]# hostnamectl set-hostname idp.xxx.xxx.xxx |
考虑到SELinux 的复杂性,在测试及运行IdP的环境关闭了SElinux,如有学校需要打开SElinux功能,请自行进行测试及配置。
#关闭开机启动SELinux [root@www ~]#setenforce 0 [root@www ~]# vi /etc/selinux/config # line 7:修改如下。此修改重启系统后生效。 SELINUX=disabled # 查看当前selinux状态 [root@www ~]# getenforce disabled #表示selinux已关闭 |
IdP运行需要与SP通信,通信过程需要严格保证时间同步,否则会出现异常,因此需要为IdP服务器配置时间同步服务器。
如果学校有自建NTP服务器,请修改以下参数配置为学校NTP服务器IP地址或域名,如果学校没有自建NTP服务器可以使用阿里云NTP服务器。
[root@www ~]# yum -y install ntp [root@www ~]# ntpdate -u ntp.aliyun.com [root@www ~]# timedatectl set-timezone Asia/Shanghai #编辑 /etc/ntp.conf,注释掉默认境外ntp服务器,添加国内时间同步服务器,推荐使用学校自有ntp服务器,如果没有可使用阿里云ntp服务器 [root@www ~]# vi /etc/ntp.conf #server 0.centos.pool.ntp.org iburst #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server 3.centos.pool.ntp.org iburst server ntp.aliyun.com #设置时间同步服务开机自动启动,并且查看当前状态 [root@www ~]# systemctl start ntpd [root@www ~]# systemctl enable ntpd [root@www ~]# ntpdc -p |
IdP服务器仅开放443和22端口,IdP通过443端口提供https web服务,必须打开。
如果有学校使如使用Let's Encrypt数字证书,则需要打开80端口用于更新数字证书,IdP v4.1.7默认配置关闭80端口,如果需要开放80端口,请修改/etc/nginx/nginx.conf配置文件,取消80端口的注释并重启nginx。
本机防火墙上开放相应端口(https分别对应443和80)
[root@www ~]# firewall-cmd --add-service=https --permanent [root@www ~]# firewall-cmd --add-service=http --permanent |
刷新本机防火墙
[root@www ~]# firewall-cmd --reload |
如果本机接入网络中配置有其他防火墙,请联系防火墙管理员开通:允许外部服务器访问本机443端口(TCP端口)。
[root@www ~]# useradd carsi [root@www ~]# passwd carsi Changing password for user carsi. New password: //输入carsi密码 Retype new password: //再次输入carsi密码 passwd: all authentication tokens updated successfully. |
[root@www ~]# chmod 700 /etc/sudoers [root@www ~]# vi /etc/sudoers #加入以下配置 carsi ALL=(ALL) ALL |
注:保存文件时请使用:w!进行强制保存,建议学校根据本校实际情况对carsi的sudo授权配置进行精细管理。
[root@www ~]# vi /etc/ssh/sshd_config 修改 #PermitRootLogin yes 为 PermitRootLogin no |
[root@www ~]# rpm -qa|grep java |
IdP417安装脚本会自动安装java-11-openjdk-devel-11.0.10,如果已经安装了其它版本Java,建议删除。
[root@www ~]# reboot |