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

网站开发设计软件长沙市师德师风建设网站

网站开发设计软件,长沙市师德师风建设网站,汕头网络推广平台,天河区进一步1.前提 虚拟机能连接外网 仿真http应用需在本虚拟机启用(原因#xff1a;只有一台虚拟机做测试) http_8080和http_8081要启用#xff08;http测试应用#xff09; [rootcent79-2 ~]# ls -l http_* -rwxr-xr-x 1 root root 6391676 Jul 19 13:39 http_8080 -rwxr-xr-x 1 …1.前提 虚拟机能连接外网 仿真http应用需在本虚拟机启用(原因只有一台虚拟机做测试) http_8080和http_8081要启用http测试应用 [rootcent79-2 ~]# ls -l http_* -rwxr-xr-x 1 root root 6391676 Jul 19 13:39 http_8080 -rwxr-xr-x 1 root root 6391676 Jul 19 13:39 http_8081 [rootcent79-2 ~]# ./http_8080 [1] 1490 [rootcent79-2 ~]# ./http_8081 [2] 1496 [rootcent79-2 ~]# netstat -antulp |grep 8080 tcp6 0 0 :::8080 :::* LISTEN 1490/./http_8080 [rootcent79-2 ~]# netstat -antulp |grep 8081 tcp6 0 0 :::8081 :::* LISTEN 1496/./http_8081 [rootcent79-2 ~]# curl 192.168.10.156:8080 {text:I am one!} [rootcent79-2 ~]# curl 192.168.10.156:8081 {text:I am two!} [rootcent79-2 ~]# 2.Ngnix配置反向代理 2.1.Nginx配置单个反向代理 1.编辑nginx配置文件nginx.conf添加反向代理配置 user  nginx  nginx; worker_processes  2; worker_rlimit_nofile 1024; error_log  /var/log/nginx/error.log notice; pid        /var/run/nginx.pid; events {     use epoll;     worker_connections  1024;     multi_accept  on; } http {     include       /etc/nginx/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  /var/log/nginx/access.log  main;     sendfile        on;     tcp_nopush     on;     autoindex    on;     keepalive_timeout  65;     #gzip  on;     include /etc/nginx/conf.d/*.conf;     server {     listen  80;     server_name 192.168.10.156;     location / {       proxy_pass http://www.baidu.com;     }     } } 2.nginx语法验证 命令 nginx -t [rootcent79-2 ~]# nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful [rootcent79-2 ~]# 3.重启nginx 命令 systemctl restart nginx systemctl status nginx [rootcent79-2 ~]# systemctl restart nginx [rootcent79-2 ~]# systemctl status nginx ● nginx.service - nginx - high performance web server    Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)    Active: active (running) since Thu 2023-07-20 20:16:16 CST; 3s ago      Docs: http://nginx.org/en/docs/   Process: 2504 ExecStop/bin/sh -c /bin/kill -s TERM $(/bin/cat /var/run/nginx.pid) (codeexited, status0/SUCCESS)   Process: 2509 ExecStart/usr/sbin/nginx -c /etc/nginx/nginx.conf (codeexited, status0/SUCCESS)  Main PID: 2510 (nginx)    CGroup: /system.slice/nginx.service            ├─2510 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf            ├─2511 nginx: worker process            └─2512 nginx: worker process Jul 20 20:16:15 cent79-2 systemd[1]: Starting nginx - high performance web server... Jul 20 20:16:16 cent79-2 systemd[1]: Started nginx - high performance web server. [rootcent79-2 ~]# 4.反向代理验证 地址 http://192.168.10.156 转向为 2.2.Nginx配置反向代理集群 1.编辑nginx配置文件nginx.conf添加反向代理配置 user  nginx  nginx; worker_processes  2; worker_rlimit_nofile 1024; error_log  /var/log/nginx/error.log notice; pid        /var/run/nginx.pid; events {     use epoll;     worker_connections  1024;     multi_accept  on; } http {     include       /etc/nginx/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  /var/log/nginx/access.log  main;     sendfile        on;     tcp_nopush     on;     autoindex    on;     keepalive_timeout  65;     #gzip  on;     include /etc/nginx/conf.d/*.conf;        upstream www.ztj.com {       server 192.168.10.156:8080 weight1 max_fails2 fail_timeout15s;       server 192.168.10.156:8081 weight1 max_fails2 fail_timeout15s;     }     server {     listen  80;     server_name 192.168.10.156;     location / {      proxy_pass http://www.ztj.com;     }     } } 2.nginx语法验证 命令 nginx -t [rootcent79-2 ~]# nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful [rootcent79-2 ~]# 3.重启nginx 命令 systemctl restart nginx systemctl status nginx [rootcent79-2 ~]# systemctl restart nginx [rootcent79-2 ~]# systemctl status nginx ● nginx.service - nginx - high performance web server    Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)    Active: active (running) since Thu 2023-07-20 20:32:50 CST; 4s ago      Docs: http://nginx.org/en/docs/   Process: 2673 ExecStop/bin/sh -c /bin/kill -s TERM $(/bin/cat /var/run/nginx.pid) (codeexited, status0/SUCCESS)   Process: 2678 ExecStart/usr/sbin/nginx -c /etc/nginx/nginx.conf (codeexited, status0/SUCCESS)  Main PID: 2679 (nginx)    CGroup: /system.slice/nginx.service            ├─2679 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf            ├─2680 nginx: worker process            └─2681 nginx: worker process Jul 20 20:32:50 cent79-2 systemd[1]: Stopped nginx - high performance web server. Jul 20 20:32:50 cent79-2 systemd[1]: Starting nginx - high performance web server... Jul 20 20:32:50 cent79-2 systemd[1]: Started nginx - high performance web server. [rootcent79-2 ~]# 4.反向代理集群验证 命令curl 192.168.10.156 [rootcent79-2 ~]# curl 192.168.10.156 {text:I am one!} [rootcent79-2 ~]# curl 192.168.10.156 {text:I am two!} [rootcent79-2 ~]# 2.3.Nginx配置基于context的反向代理(重点) 1.编辑nginx配置文件nginx.conf添加反向代理配置 user  nginx  nginx; worker_processes  2; worker_rlimit_nofile 1024; error_log  /var/log/nginx/error.log notice; pid        /var/run/nginx.pid; events {     use epoll;     worker_connections  1024;     multi_accept  on; } http {     include       /etc/nginx/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  /var/log/nginx/access.log  main;     sendfile        on;     tcp_nopush     on;     autoindex    on;     keepalive_timeout  65;     #gzip  on;     include /etc/nginx/conf.d/*.conf;        server {     listen  80;     server_name 192.168.10.156;     location / {      proxy_pass http://www.baidu.com;     }         location /root {       proxy_pass http://127.0.0.1:8080;         location /root/api {          proxy_pass http://127.0.0.1:8081;         }       }     } } 2.nginx语法验证 命令 nginx -t [rootcent79-2 ~]# nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful [rootcent79-2 ~]# 3.重启nginx 命令 systemctl restart nginx systemctl status nginx [rootcent79-2 ~]# systemctl restart nginx [rootcent79-2 ~]# systemctl status nginx ● nginx.service - nginx - high performance web server    Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)    Active: active (running) since Thu 2023-07-20 20:39:33 CST; 2s ago      Docs: http://nginx.org/en/docs/   Process: 2713 ExecStop/bin/sh -c /bin/kill -s TERM $(/bin/cat /var/run/nginx.pid) (codeexited, status0/SUCCESS)   Process: 2718 ExecStart/usr/sbin/nginx -c /etc/nginx/nginx.conf (codeexited, status0/SUCCESS)  Main PID: 2719 (nginx)    CGroup: /system.slice/nginx.service            ├─2719 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf            ├─2720 nginx: worker process            └─2721 nginx: worker process Jul 20 20:39:33 cent79-2 systemd[1]: Starting nginx - high performance web server... Jul 20 20:39:33 cent79-2 systemd[1]: Started nginx - high performance web server. [rootcent79-2 ~]# 4.反向代理context验证 http://192..168.10.156 http://192..168.10.156/root http://192..168.10.156/root/api
http://www.hkea.cn/news/14338969/

相关文章:

  • 南充 网站建设做爰全过程网站免费的视频教程
  • 网络营销相关的资源网站电商网站建设思维导图
  • 关键词查询的分析网站不良网站举报中心官网
  • 童装 技术支持 东莞网站建设上海发布官网app下载
  • 网站制作 需要什么网络技术做品牌网站哪个好点
  • php做网站特效空间设计图片
  • 保险网站建设平台wordpress 计划表格
  • 石家庄小学网站建设证书在线制作生成器
  • 多语言网站系统网页小游戏在线玩知乎
  • 如何拥有自己的网站域名珠海建设改革有哪些网站
  • 公司网站建设指南项目管理软件模块
  • 怎么注册自己的网站域名网站建设内容介绍
  • 网站公司好做吗企业网站建设 建立作用
  • 郑州公共住宅建设投资有限公司网站做淘宝优惠卷网站步骤
  • 黄冈商城网站制作哪家好潍坊网络营销外包
  • 智慧团建登录网站入口网页设计基础的课程介绍
  • 三门峡住房和建设局网站牡丹江市建设行业协会网站
  • 南京旅游网站建设公司网站建设编码
  • 台州平台网站建设公司注册地址可以跨市变更吗
  • 南昌旅游集团网站建设河北建设工程交易信息网
  • 公司对网站排名如何做绩效263企业邮箱app下载官网
  • 网站模板尺寸百度广告平台电话
  • 网站开发 附加协议在线免费货源网站入口
  • 可以做用户旅程图的网站中国各大网站名称
  • 简单网站后台兰州光辉网站建设
  • 浙江国泰建设集团有限公司网站psd to wordpress
  • 中山cms建站模板室内设计师联盟账号
  • 如何快速做一个网站布吉做棋牌网站建设哪家技术好
  • 奉节网站建设公司响应式网站建设对企业营销
  • 个人做旅游网站怎样宁夏建设厅网站6