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

邢台市住房和城乡建设局网站擦边球网站怎么做

邢台市住房和城乡建设局网站,擦边球网站怎么做,用.net做的网站,龙岩做网站的地方文章目录 Nginx平滑升级重定向rewritenginx平滑升级流程环境查看旧版的配置信息下载新版nginx源码包和功能模块包编译配置新版本平滑升级验证 重定向rewrite配置重定向准发访问测试 Nginx平滑升级重定向rewrite nginx平滑升级 流程 平滑升级: (升级版本、增加新功… 文章目录 Nginx平滑升级重定向rewritenginx平滑升级流程环境查看旧版的配置信息下载新版nginx源码包和功能模块包编译配置新版本平滑升级验证 重定向rewrite配置重定向准发访问测试 Nginx平滑升级重定向rewrite nginx平滑升级 流程 平滑升级: (升级版本、增加新功能) 1.获取老版本的编译信息 2.老版本备份 3.编译新版本或者新功能(不能执行make install) 4.手动替换新版本并重启 5.验证新版本 环境 操作系统旧版本新版本新加功能centos-8nginx-1.22.1nginx-1.24.0echo-nginx-module 部署nginx请阅读nginx服务和LNMP架构部署Discuz论坛系统 查看旧版的配置信息 升级的同时要保留旧版的功能所以要查看详细的编译信息 //查看当前版本nginx的详细信息记住旧版的编译信息 [rootwanf ~]# nginx -V nginx version: nginx/1.22.1 built by gcc 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC) built with OpenSSL 1.1.1k FIPS 25 Mar 2021 TLS SNI support enabled configure arguments: --prefix/usr/local/nginx --usernginx --groupnginx --with-debug --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --http-log-path/var/log/nginx/access.log --error-log-path/var/log/nginx/error.log [rootwanf ~]# 下载新版nginx源码包和功能模块包 Nginx官网 GitHub官网 //下载新版nginx源码包 [rootwanf ~]# wget http://nginx.org/download/nginx-1.24.0.tar.gz -P /usr/src/ [rootwanf ~]# ls /usr/src/ debug nginx-1.22.1 nginx-1.24.0.tar.gz php-8.2.10.tar.gz kernels nginx-1.22.1.tar.gz php-8.2.10//在GitHub下载模块代码 [rootwanf ~]# yum -y install git [rootwanf ~]# git clone https://github.com/openresty/echo-nginx-module.git [rootwanf ~]# mv echo-nginx-module/ /usr/src/ [rootwanf ~]# ls /usr/src/ debug kernels nginx-1.22.1.tar.gz php-8.2.10 echo-nginx-module nginx-1.22.1 nginx-1.24.0.tar.gz php-8.2.10.tar.gz [rootwanf ~]# 编译配置新版本 //备份旧版nginx主程序 [rootwanf ~]# cp /usr/local/nginx/sbin/nginx /opt/nginx-buckup-20231019 [rootwanf ~]# ls /opt/ nginx-buckup-20231019//复制旧版的编译参数并加上新的功能模块进行编译 [rootwanf ~]# cd /usr/src/ [rootwanf src]# ls debug kernels nginx-1.22.1.tar.gz php-8.2.10 echo-nginx-module nginx-1.22.1 nginx-1.24.0.tar.gz php-8.2.10.tar.gz [rootwanf src]# tar -xf nginx-1.24.0.tar.gz [rootwanf src]# cd nginx-1.24.0/ [rootwanf nginx-1.24.0]# ./configure \ --prefix/usr/local/nginx \ --usernginx \ --groupnginx \ --with-debug \ --with-http_ssl_module \ --with-http_realip_module \ --with-http_image_filter_module \ --with-http_gunzip_module \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --http-log-path/var/log/nginx/access.log \ --error-log-path/var/log/nginx/error.log \ --add-module../echo-nginx-module/ 配置过程省略//编译新版本只执行make不执行make install [rootwanf nginx-1.24.0]# make 编译过程省略平滑升级 先关闭旧版nginx服务然后把新编译的nginx主程序替换掉旧版再启动服务即可 //新版nginx主程序文件/opjs/nginx就是主程序 [rootwanf nginx-1.24.0]# ls auto CHANGES.ru configure html Makefile objs src CHANGES conf contrib LICENSE man README [rootwanf nginx-1.24.0]# ls objs/ addon Makefile nginx.8 ngx_auto_headers.h ngx_modules.o autoconf.err nginx ngx_auto_config.h ngx_modules.c src [rootwanf nginx-1.24.0]# //平滑升级。停止服务替换文件启动服务要一步执行完。否则可能导致升级失败。 [rootwanf nginx-1.24.0]# cd objs/ [rootwanf objs]# systemctl stop nginx;\cp nginx /usr/local/nginx/sbin/nginx;systemctl start nginx验证 //端口号80已经启动 [rootwanf objs]# ss -anlt State Recv-Q Send-Q Local Address:Port Peer Address:Port Process LISTEN 0 128 127.0.0.1:9000 0.0.0.0:* LISTEN 0 511 0.0.0.0:80 0.0.0.0:* LISTEN 0 128 0.0.0.0:22 0.0.0.0:* LISTEN 0 80 *:3306 *:* LISTEN 0 128 [::]:22 [::]:* //已经升级为新版nginx-1.24.0 [rootwanf objs]# nginx -v nginx version: nginx/1.24.0 [rootwanf objs]# //测试新添加的echo功能 //修改配置文件 [rootwanf ~]# vim /usr/local/nginx/conf/nginx.conf ...... location /status {echo hallo wanf;stub_status on;allow 192.168.179.0/24;deny all;} ......//测试配置文件语法语法没有报错 [rootwanf ~]# nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful [rootwanf ~]# 升级成功 重定向rewrite 以下是拿Discuz论坛系统做案例 假设原来的域名是www.wanf2.com但是公司换了新的域名为www.wanf1.com那么用户使用旧域名就无法访问到论坛系统 LNMP架构部署论坛系统请阅读LNMP架构部署Discuz论坛系统 旧域名无法访问 使用新域名可以访问 配置重定向准发 为了用户体验需要做一个转发让用户访问旧域名的时候会跳转到新域名 //修改配置文件在旧域名的虚拟主机里面添加一个转发 [rootwanf ~]# vim /usr/local/nginx/conf/nginx.conf ......server {listen 80;server_name www.wanf2.com;location / {root html;index index.php index.html index.htm;rewrite ^/(.*)$ http://www.wanf1.com/$1 break; //添加此行改为新域名}error_page 500 502 503 504 /50x.html;location /50x.html {root html;}location ~ \.php$ {root html;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;include fastcgi.conf;}} ......//重启服务 [rootwanf ~]# systemctl restart nginx.service [rootwanf ~]# systemctl restart php-fpm.service 访问测试 访问旧域名自动跳转访问新域名 访问新域名直接可以访问
http://www.hkea.cn/news/14371006/

相关文章:

  • 欧赛网站建设wordpress博客文章tdk设置
  • ui设计的推荐网站及网址wordpress跳转自适应
  • 宁波市镇海建设交通局网站唐山做网站企业
  • 深圳网站建设电话咨询人工智能网站应怎么做
  • 网站里的聊天怎么做广告设计制作公司经营范围
  • 网站建设类型有哪些方面中铁建设集团门户网登录不上去
  • 产品推广词南宁软件优化网站建设
  • 出版社类网站模板辉煌电商seo
  • 好的建站网站上海中国国际进口博览会
  • 个人网站建设需要多少钱网站建设faq系统指什么
  • 做印刷哪个网站好WordPress为什么卡
  • 外贸网站平台有几个163网易邮箱
  • 局域网站建设教程申报教学成果奖网站建设
  • 特别酷炫网站个人网页设计模板html代码
  • 旅行社网站建设规划的内容wordpress 商品推广
  • 网站一年费用多少钱模板网站和定制网站影响排名
  • 江西省建设质量监督局网站开源微信商城源码
  • 站长网网站模板下载青海企业网站建设开发
  • 电子商务网站建设需求概述网站开发需要的软件有哪些
  • 境外电商平台有哪些青岛网站建设优化
  • 海南城乡和住房建设厅网站施工企业造价管理
  • 建设部网人事考试网站建设校园网站的好处
  • 网站建设京icp备自由人网站开发
  • 自己怎么建个免费网站手机网站功能开发方案
  • 建设网站要多久到账西安技术网站建设
  • 网站有什么组成wordpress 去除版本号
  • 网站制作赚钱吗企业所得税税率5%
  • 茂县建设局网站三维免费网站
  • 能利用双股铜芯电话线做网站吗腾讯云做视频网站吗
  • 邵武建设局网站搜索公司信息的软件