博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Win10上搭建Nginx+SimpleSAMLphp认证服务
阅读量:4107 次
发布时间:2019-05-25

本文共 2946 字,大约阅读时间需要 9 分钟。

本文主要阐述Windows环境上搭建SimpleSAMLphp Web认证服务。

1.运行环境

本文的的运行环境为:

OS: Win10 64Bit

Nginx: 1.8.0

PHP: 7.0.2 64Bit

MySQL: 5.7.10  64Bit

2.下载源码并解压

目前最新的版本是v1.13.2,下载地址为https://simplesamlphp.org/res/downloads/simplesamlphp-1.13.2.tar.gz

下载下来解压缩到本地硬盘,假设解压缩到G:\Web\simplesamlphp目录。

3.配置Nginx

修改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/

你可能感兴趣的文章
通过Spring Boot三分钟创建Spring Web项目
查看>>
Java编程基础:static的用法
查看>>
Java编程基础:抽象类和接口
查看>>
Java编程基础:异常处理
查看>>
Spring MVC中使用Thymeleaf模板引擎
查看>>
Spring处理表单提交
查看>>
Spring MVC异常处理
查看>>
PHP 7 的五大新特性
查看>>
PHP底层的运行机制与原理
查看>>
深入了解php底层机制
查看>>
PHP中的stdClass 【转】
查看>>
XHProf-php轻量级的性能分析工具
查看>>
PHP7新特性 What will be in PHP 7/PHPNG
查看>>
比较strtr, str_replace和preg_replace三个函数的效率
查看>>
PHP编译configure时常见错误 debian centos
查看>>
configure: error: Please reinstall the BZip2 distribution
查看>>
OpenCV gpu模块样例注释:video_reader.cpp
查看>>
【增强学习在无人驾驶中的应用】
查看>>
OpenCV meanshift目标跟踪总结
查看>>
都无代码了,还要程序员吗?
查看>>