当前位置: 首页 > news >正文

北京建设网站专家微信开放平台 网站应用开发

北京建设网站专家,微信开放平台 网站应用开发,我要找个做网站的公司,我要下载中国建设网站1#xff0c;openresty 源码安装#xff0c;带ssl模块 https://openresty.org/cn/download.html #xff08;1#xff09;PCRE库 PCRE库支持正则表达式。如果我们在配置文件nginx.conf中使用了正则表达式#xff0c;那么在编译Nginx时就必须把PCRE库编译进Nginx#xf…1openresty 源码安装带ssl模块 https://openresty.org/cn/download.html 1PCRE库 PCRE库支持正则表达式。如果我们在配置文件nginx.conf中使用了正则表达式那么在编译Nginx时就必须把PCRE库编译进Nginx因为Nginx的HTTP模块需要靠它来解析正则表达式。另外pcre-devel是使用PCRE做二次开发时所需要的开发库包括头文件等这也是编译Nginx所必须使用的。 2zlib库 zlib库用于对HTTP包的内容做gzip格式的压缩如果我们在nginx.conf中配置了gzip on并指定对于某些类型content-type的HTTP响应使用gzip来进行压缩以减少网络传输量则在编译时就必须把zlib编译进Nginx。zlib-devel是二次开发所需要的库。 3OpenSSL库 如果服务器不只是要支持HTTP还需要在更安全的SSL协议上传输HTTP那么需要拥有OpenSSL。另外如果我们想使用MD5、SHA1等散列函数那么也需要安装它。 apt-get install -y libssl-dev libpcre3 libpcre3-dev zlib1g-devwget https://openresty.org/download/openresty-1.27.1.1.tar.gztar -zxvf openresty-1.27.1.1.tar.gz cd openresty-1.27.1.1/./configure gmake gmake install Configuration summary using system PCRE library using system OpenSSL library using system zlib librarycp conf/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf.default test -d /usr/local/openresty/nginx/logs \|| mkdir -p /usr/local/openresty/nginx/logs test -d /usr/local/openresty/nginx/logs \|| mkdir -p /usr/local/openresty/nginx/logs test -d /usr/local/openresty/nginx/html \|| cp -R docs/html /usr/local/openresty/nginx test -d /usr/local/openresty/nginx/logs \|| mkdir -p /usr/local/openresty/nginx/logs gmake[2]: Leaving directory /data/openresty-1.27.1.1/build/nginx-1.27.1 gmake[1]: Leaving directory /data/openresty-1.27.1.1/build/nginx-1.27.1 mkdir -p /usr/local/openresty/site/lualib /usr/local/openresty/site/pod /usr/local/openresty/site/manifest ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/local/openresty/bin/openresty 2增加openresty 没有service服务开机启动 增加一个服务配置 vi /etc/systemd/system/openresty.service[Unit] DescriptionOpenResty nginx server Afternetwork.target[Service] Typeforking ExecStart/usr/local/openresty/bin/openresty -c /usr/local/openresty/nginx/conf/nginx.conf ExecReload/usr/local/openresty/bin/openresty -c /usr/local/openresty/nginx/conf/nginx.conf -s reload ExecStop/usr/local/openresty/bin/openresty -s stop PrivateTmptrue[Install] WantedBymulti-user.target然后重启服务 # 配置变了重新加载下 systemctl daemon-reload# 重启服务 systemctl restart openresty# 增加开机启动服务 systemctl enable openresty 3自签名证书在OpenResty中配置SSL OpenResty是一个基于Nginx的高性能Web平台支持多种功能扩展。配置SSL可以使网站通过HTTPS协议进行加密传输提升安全性。以下是如何在OpenResty中配置SSL的步骤。 生成服务器私钥和证书 首先确保已经安装了OpenResty和OpenSSL。在OpenResty的配置目录下创建一个cert文件夹用于存放证书和私钥。 mkdir -p /usr/local/openresty/nginx/conf/cert cd /usr/local/openresty/nginx/conf/cert# 生成4096字节的服务器私钥 openssl genrsa -des3 -out server.key 4096# 创建签名请求的证书CSR openssl req -new -key server.key -out server.csr# 根据提示输入相关信息例如国家、州、省、市、组织名称等。 # 去除私钥的口令保护 cp server.key server.key.org openssl rsa -in server.key.org -out server.key# 生成证书文件 openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt 5配置Nginx.conf 编辑Nginx的配置文件nginx.conf添加SSL相关配置。 server {listen 443 ssl;server_name localhost;ssl_certificate /usr/local/openresty/nginx/conf/cert/server.crt;ssl_certificate_key /usr/local/openresty/nginx/conf/cert/server.key;ssl_session_cache shared:SSL:5m;ssl_session_timeout 5m;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;ssl_prefer_server_ciphers on;location / {alias html/;index index.html index.htm;try_files $uri $uri/ /index.html;client_max_body_size 100M; } }6重启Nginx 保存配置文件后重启Nginx以应用新的配置。 sudo systemctl restart openresty验证HTTPS 在浏览器中访问配置的域名或IP地址确保能够通过HTTPS协议访问网站。 将HTTP请求重定向到HTTPS 为了确保所有HTTP请求都重定向到HTTPS可以在Nginx配置文件中添加以下配置 server { listen 80; server_name localhost; rewrite ^(.*)$ https://$host$1 permanent; }通过以上步骤您可以在OpenResty中成功配置SSL使网站支持HTTPS协议 7可以访问https地址了
http://www.w-s-a.com/news/413277/

相关文章:

  • 公司做网站广告语济南建网站价格消费品展
  • 建德网站网站建设规划设计书
  • 谷歌网站流量分析wordpress置顶浮标
  • 江苏新宁建设集团网站网络规划设计师2023论文
  • 合作建站协议python wordpress采集器
  • 集团网站网页模板网站建设图片大全
  • 举报非法网站要求做笔录wordpress怎么插视频
  • 网站服务器防护如何搭建网站平台
  • 设计师接私活的网站如何做网站的搜索栏
  • ps做图下载网站网站子目录设计
  • 厦门网站制作策划高中生做网站网页
  • 高端品牌网站建设在哪济南兴田德润优惠吗专业定制网站开发公司
  • 怎么做网站卖东西汽车网站排行榜前十名
  • 网站关键字没有排名只有单页面的网站怎么做seo
  • 网站流量盈利模式宝塔没有域名直接做网站怎么弄
  • 淡蓝色网站qq推广中心
  • 设计网站价格餐饮吸引客流的活动方案
  • 手机网站建设电话百度搜索量
  • 条件查询 php网站源码中国白云手机网站建设
  • 网上注册公司流程及材料班级优化大师免费下载电脑版
  • 应用网站如何做营销型网站的重要特点
  • 怎么样百度搜到自己的网站加强社区网站建设
  • 建设网站所需技术wordpress延时加载js
  • 网站建设沈阳搜云seo
  • 怎么申请免费的网站空间微信公众平台注册收费吗
  • 东营网站搭建最基本的网站设计
  • 网站建设技术的发展最近的国际新闻大事
  • 德州有名的网站建设公司网站如何做引流
  • 建设一个收入支出持平的网站网络推广计划书格式
  • 什么是网站黑链全球新冠疫苗接种率