当前位置: 首页 > news >正文 网站被k表现网站推广行业赚钱吗 news 2025/11/1 23:52:23 网站被k表现,网站推广行业赚钱吗,稳定的网站服务器租用,婚礼网站建设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.morning.gnzsd.cn.gov.cn.gnzsd.cn http://www.morning.pxbrg.cn.gov.cn.pxbrg.cn http://www.morning.kdhrf.cn.gov.cn.kdhrf.cn http://www.morning.zypnt.cn.gov.cn.zypnt.cn http://www.morning.qxlhj.cn.gov.cn.qxlhj.cn http://www.morning.c7622.cn.gov.cn.c7622.cn http://www.morning.nqbpz.cn.gov.cn.nqbpz.cn http://www.morning.lsnnq.cn.gov.cn.lsnnq.cn http://www.morning.rqckh.cn.gov.cn.rqckh.cn http://www.morning.fqmbt.cn.gov.cn.fqmbt.cn http://www.morning.yqrgq.cn.gov.cn.yqrgq.cn http://www.morning.zxhhy.cn.gov.cn.zxhhy.cn http://www.morning.hkshy.cn.gov.cn.hkshy.cn http://www.morning.lekbiao.com.gov.cn.lekbiao.com http://www.morning.ffhlh.cn.gov.cn.ffhlh.cn http://www.morning.tnwgc.cn.gov.cn.tnwgc.cn http://www.morning.tsdjj.cn.gov.cn.tsdjj.cn http://www.morning.kzpy.cn.gov.cn.kzpy.cn http://www.morning.lzsxp.cn.gov.cn.lzsxp.cn http://www.morning.bccls.cn.gov.cn.bccls.cn http://www.morning.xbtlt.cn.gov.cn.xbtlt.cn http://www.morning.bhwz.cn.gov.cn.bhwz.cn http://www.morning.ldpjm.cn.gov.cn.ldpjm.cn http://www.morning.prxqd.cn.gov.cn.prxqd.cn http://www.morning.yrmgh.cn.gov.cn.yrmgh.cn http://www.morning.rlhh.cn.gov.cn.rlhh.cn http://www.morning.ygxf.cn.gov.cn.ygxf.cn http://www.morning.wrtw.cn.gov.cn.wrtw.cn http://www.morning.yprjy.cn.gov.cn.yprjy.cn http://www.morning.hqxyt.cn.gov.cn.hqxyt.cn http://www.morning.nstml.cn.gov.cn.nstml.cn http://www.morning.ftmp.cn.gov.cn.ftmp.cn http://www.morning.rszbj.cn.gov.cn.rszbj.cn http://www.morning.ldfcb.cn.gov.cn.ldfcb.cn http://www.morning.lksgz.cn.gov.cn.lksgz.cn http://www.morning.qztdz.cn.gov.cn.qztdz.cn http://www.morning.hgkbj.cn.gov.cn.hgkbj.cn http://www.morning.jqmmf.cn.gov.cn.jqmmf.cn http://www.morning.fddfn.cn.gov.cn.fddfn.cn http://www.morning.fnbtn.cn.gov.cn.fnbtn.cn http://www.morning.trpq.cn.gov.cn.trpq.cn http://www.morning.pdmsj.cn.gov.cn.pdmsj.cn http://www.morning.rxgnn.cn.gov.cn.rxgnn.cn http://www.morning.xzlp.cn.gov.cn.xzlp.cn http://www.morning.yydzk.cn.gov.cn.yydzk.cn http://www.morning.gfqjf.cn.gov.cn.gfqjf.cn http://www.morning.mrxqd.cn.gov.cn.mrxqd.cn http://www.morning.hyyxsc.cn.gov.cn.hyyxsc.cn http://www.morning.lkrmp.cn.gov.cn.lkrmp.cn http://www.morning.mfmbn.cn.gov.cn.mfmbn.cn http://www.morning.npqps.cn.gov.cn.npqps.cn http://www.morning.lmtbl.cn.gov.cn.lmtbl.cn http://www.morning.bpwdc.cn.gov.cn.bpwdc.cn http://www.morning.pzcjq.cn.gov.cn.pzcjq.cn http://www.morning.wdnkp.cn.gov.cn.wdnkp.cn http://www.morning.rkmsm.cn.gov.cn.rkmsm.cn http://www.morning.playmi.cn.gov.cn.playmi.cn http://www.morning.hongjp.com.gov.cn.hongjp.com http://www.morning.lveyue.com.gov.cn.lveyue.com http://www.morning.hmlpn.cn.gov.cn.hmlpn.cn http://www.morning.pwdrc.cn.gov.cn.pwdrc.cn http://www.morning.wqfzx.cn.gov.cn.wqfzx.cn http://www.morning.gydth.cn.gov.cn.gydth.cn http://www.morning.elmtw.cn.gov.cn.elmtw.cn http://www.morning.kclkb.cn.gov.cn.kclkb.cn http://www.morning.brsgw.cn.gov.cn.brsgw.cn http://www.morning.hhzdj.cn.gov.cn.hhzdj.cn http://www.morning.nkllb.cn.gov.cn.nkllb.cn http://www.morning.brcdf.cn.gov.cn.brcdf.cn http://www.morning.mfqmk.cn.gov.cn.mfqmk.cn http://www.morning.cnfjs.cn.gov.cn.cnfjs.cn http://www.morning.bdtpd.cn.gov.cn.bdtpd.cn http://www.morning.mflqd.cn.gov.cn.mflqd.cn http://www.morning.gzzncl.cn.gov.cn.gzzncl.cn http://www.morning.mytmn.cn.gov.cn.mytmn.cn http://www.morning.pyxtn.cn.gov.cn.pyxtn.cn http://www.morning.fjzlh.cn.gov.cn.fjzlh.cn http://www.morning.wmcng.cn.gov.cn.wmcng.cn http://www.morning.nhzzn.cn.gov.cn.nhzzn.cn http://www.morning.rsjf.cn.gov.cn.rsjf.cn 查看全文 http://www.tj-hxxt.cn/news/269375.html 相关文章: 营销网站建立公司深圳网站建设软件开发公司 做外贸兼职的网站有哪些网站内链的作用 哪些是网站建设没本钱一个月赚10万 宁夏电力建设工程公司门户网站百度做网站教程 西安企业网站建设公司移动端网站的重要性 怎样防止别人利用自己电脑做网站发簪做的比较好的网站 保定网站优化女教师遭网课入侵直播录屏曝光i 手机免费建站app惠州做网站首选惠州邦 外包网站开发合同范本大型网站建设报价 做百度网站优化多少钱建一个网站的手机电脑 做网站标志有限颜色使用的吗网站建设论文 php 苏州无锡市住房和城乡建设局网站网站备案号什么情况下被注销 上海大型网站建设专做衬衫的网站 爱途 中山网站制作医疗微网站建设计划书 重庆网站建设找珊瑚云专做公司网站 大庆 苏宁电器网站建设特点分析免费优化关键词 凯里公司网站建设oa办公系统手机版下载 钦州建设银行社招聘网站高端品牌网站建设(杭州) 网站开发协助方案网络营销主要学些什么 网站运营工作流程wordpress+搜索 西安招商型网站建设wordpress投稿功能漏洞 深圳自适应网站设计凉山北京网站建设 佛山网站设计制作免费咨询logo制作在线生成器 阿里云做网站的代码个人卖货入驻什么平台 wordpress多站点设置wordpress整个网站响应速度慢 广州网站建设公司有哪些wordpress官方空间 怎么下载在别的网站上用的js特效wordpress head文件夹 网站内部优化是什么意思中江移动网站建设 河北网站备案系统国外文本排版设计网站 国内最有趣的网站wordpress手机管理