本文共 2946 字,大约阅读时间需要 9 分钟。
本文主要阐述Windows环境上搭建SimpleSAMLphp Web认证服务。
本文的的运行环境为:
OS: Win10 64Bit
Nginx: 1.8.0
PHP: 7.0.2 64Bit
MySQL: 5.7.10 64Bit
目前最新的版本是v1.13.2,下载地址为https://simplesamlphp.org/res/downloads/simplesamlphp-1.13.2.tar.gz
下载下来解压缩到本地硬盘,假设解压缩到G:\Web\simplesamlphp目录。
修改Nginx的配置文件,如下:
#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name saml.dev; set $root_path 'G:/Web/simplesamlphp/www'; root $root_path; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } location ~ \.php(/|$) { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^\/simplesaml(.+?\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ ^/simplesaml/(.+\.(?:gif|jpe?g|png|js|css))$ { alias G:/Web/simplesamlphp/www/$1; } location ~ \.php(/|$) { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+?\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.ht { deny all; } } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.html index.htm; # } #} # HTTPS server # #server { # listen 443 ssl; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #}}
重启之后,就可以运行SimpleSAMLphp服务了。
转载地址:http://rapsi.baihongyu.com/