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

企业手机网站建设策划方案淘宝补流量平台

企业手机网站建设策划方案,淘宝补流量平台,可以做全职的设计师网站,个人网页设计版面一、Nginx反向代理(七层代理) 实验要求 使用Nginx实现Web反向代理功能,实现如下功能: 后端Web服务器两台,可以使用httpd实现Nginx采用轮询的方式调用后端Web服务器两台Web服务器的权重要求设置为不同的值最大失败次数为…
一、Nginx反向代理(七层代理)
实验要求
使用Nginx实现Web反向代理功能,实现如下功能: 后端Web服务器两台,可以使用httpd实现Nginx采用轮询的方式调用后端Web服务器两台Web服务器的权重要求设置为不同的值最大失败次数为2,失败超时时间为30秒
实验环境
以下机器全部已经存在,无须再次配置主机名	IP地址	角色
server1(已存在)	eth0:192.168.99.254/24	客户端
proxy(已存在)	eth1:192.168.99.5/24	代理服务器
web1(已存在)	eth1:192.168.99.100/24	web服务器
web2(已存在)	eth1:192.168.99.200/24	web服务器
image-202410082130582811)部署后端Web服务器
1)部署后端Web1服务器
后端Web服务器可以简单使用yum方式安装httpd实现Web服务,为了可以看出后端服务器的不同,可以将两台后端服务器的首页文档内容设置为不同的内容
[root@web1 ~]# yum -y install httpd
[root@web1 ~]# echo "web1" > /var/www/html/index.html
[root@web1 ~]# systemctl enable --now httpd2)部署后端Web2服务器
[root@web2 ~]# yum -y install  httpd
[root@web2 ~]# echo "web2" > /var/www/html/index.html
[root@web2 ~]# systemctl enable --now httpd3)使用proxy主机测试
[root@proxy ~]# curl 192.168.99.100
web1
[root@proxy ~]# curl 192.168.99.200
web2
2)配置Nginx代理服务器
添加服务器池,实现反向代理功能之前proxy主机安装的nginx已经改过很多配置,避免实验冲突,先还原proxy主机的nginx,重新安装nginx
[root@proxy ~]# /usr/local/nginx/sbin/nginx  -s stop    #如果之前没有启动,可以不用执行停止的命令
[root@proxy ~]# rm -rf /usr/local/nginx/
[root@proxy ~]# cd /root/lnmp_soft/
[root@proxy lnmp_soft]# rm -rf nginx-1.22.1
[root@proxy lnmp_soft]# tar -xf nginx-1.22.1.tar.gz
[root@proxy lnmp_soft]# cd nginx-1.22.1/
[root@proxy nginx-1.22.1]# yum -y install gcc make pcre-devel openssl-devel
[root@proxy nginx-1.22.1]# ./configure 
[root@proxy nginx-1.22.1]# make && make  install    1)修改nginx的配置文件
[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf
...
http {
...
#使用upstream定义后端服务器集群,集群名称任意(如webserver)
#使用server定义集群中的具体服务器和端口upstream webserver {server 192.168.99.100:80;server 192.168.99.200:80;}server {listen       80;server_name  localhost;#charset koi8-r;#access_log  logs/host.access.log  main;location / {root   html;index  index.html index.htm;proxy_pass http://webserver;  #通过proxy_pass将用户的请求转发给webserver集群}...2)启动nginx
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx3)使用真机浏览器做测试192.168.99.5,刷新可以看到网站的轮询效果,出现结果为 web1 或者 web2
3)配置upstream服务器集群池属性
1)设置权重
weight可以设置后台服务器的权重,权重越大任务的分配量就越大
[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf
.. ..upstream webserver {server 192.168.99.100:80 weight=2;server 192.168.99.200:80;}server {.. ..2)重新加载配置并访问,可以看到web1的任务量增加
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -s reload真机浏览器测试http://192.168.99.5,不太明显
可以使用命令行测试
[root@server1 ~]# curl 192.168.99.5
web1
[root@server1 ~]# curl 192.168.99.5
web2
[root@server1 ~]# curl 192.168.99.5
web1
[root@server1 ~]# curl 192.168.99.5
web13)设置健康检查max_fails可以设置后台服务器连不上的失败次数,fail_timeout可以设置后台服务器的失败超时时间,等待多长时间再次尝试连接
[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf
...upstream webserver {server 192.168.99.100:80;server 192.168.99.200:80 max_fails=2 fail_timeout=30;}server {...4)重新加载配置并访问
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -s reload测试时,先将web2的httpd服务关闭
[root@web2 ~]# systemctl stop  httpd使用真机命令行访问集群页面curl 192.168.99.5,只会显示web1的页面
[root@server1 ~]# curl 192.168.99.5
web1
[root@server1 ~]# curl 192.168.99.5
web1此时即使将web2的httpd服务开启也无效,因为要等待30秒
[root@web2 ~]# systemctl start  httpd
[root@server1 ~]# curl 192.168.99.5 #30秒之后再访问,web2会出现
web2
4)配置upstream服务器集群的调度算法
测试ip_hash
1)设置相同客户端访问相同Web服务器
[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf
...upstream webserver {ip_hash;server 192.168.99.100:80;server 192.168.99.200:80;}server {
...
2)重新加载配置
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -s reload3)测试只会见到一个页面
[root@server1 ~]# curl 192.168.99.5
web1
[root@server1 ~]# curl 192.168.99.5
web1
添加down标记
down标记可以让集群主机暂时不参与集群活动
[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf
...upstream webserver {server 192.168.99.100:80;server 192.168.99.200:80 down;}server {...
重新加载配置
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -s reload测试,只会见到web1
[root@server1 ~]# curl 192.168.99.5
web1
[root@server1 ~]# curl 192.168.99.5
web1二、Nginx的TCP/UDP调度器(四层代理)实验要求
使用Nginx实现TCP/UDP调度器功能,实现如下功能: 后端SSH服务器两台Nginx编译安装时需要使用--with-stream,开启ngx_stream_core_module模块Nginx采用轮询的方式调用后端SSH服务器
实验环境
以下机器全部已经存在,无须再次配置主机名	IP地址	角色
server1(已存在)	eth0:192.168.99.254/24	客户端
proxy(已存在)	eth1:192.168.99.5/24	代理服务器
web1(已存在)	eth1:192.168.99.100/24	ssh服务器
web2(已存在)	eth1:192.168.99.200/24	ssh服务器
image-202410082133113331)部署nginx服务
支持4层TCP/UDP代理的Nginx服务器 1)部署nginx服务器
编译安装必须要使用--with-stream参数开启4层代理模块
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -s stop
[root@proxy nginx-1.22.1]# rm -rf /usr/local/nginx/
[root@proxy nginx-1.22.1]# cd /root/lnmp_soft/nginx-1.22.1/
[root@proxy nginx-1.22.1]# yum -y install gcc make pcre-devel openssl-devel
[root@proxy nginx-1.22.1]# ./configure --with-stream                    #开启4层代理功能
[root@proxy nginx-1.22.1]# make && make install
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -V           #查看安装模块情况
nginx version: nginx/1.22.1
built by gcc 8.5.0 20210514 (Red Hat 8.5.0-10) (GCC) 
configure arguments: --with-stream
2)配置Nginx服务
添加服务器池,实现四层代理功能1)修改nginx配置文件[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf    #配置写到http的上方即可
...stream {upstream backend {             #创建集群,名称为backendserver 192.168.99.100:22;  #后端SSH服务器IP和端口server 192.168.99.200:22;}server {               #调用集群listen 12345;       #Nginx代理监听的端口,可以自己定义proxy_pass backend; #调用backend集群}}
http {
.. ..
}
2)启动nginx
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx 3)客户端使用访问代理服务器测试轮询效果
[root@server1 ~]# ssh 192.168.99.5 -p 12345     #使用该命令多次访问查看轮询效果
[root@web1 ~]# exit
[root@server1 ~]# ssh 192.168.99.5 -p 12345
[root@web2 ~]#

一、Nginx反向代理(七层代理)


实验要求
使用Nginx实现Web反向代理功能,实现如下功能: 
    后端Web服务器两台,可以使用httpd实现
    Nginx采用轮询的方式调用后端Web服务器
    两台Web服务器的权重要求设置为不同的值
    最大失败次数为2,失败超时时间为30秒
实验环境
以下机器全部已经存在,无须再次配置

主机名    IP地址    角色
server1(已存在)    eth0:192.168.99.254/24    客户端
proxy(已存在)    eth1:192.168.99.5/24    代理服务器
web1(已存在)    eth1:192.168.99.100/24    web服务器
web2(已存在)    eth1:192.168.99.200/24    web服务器
image-20241008213058281

1)部署后端Web服务器
1)部署后端Web1服务器
后端Web服务器可以简单使用yum方式安装httpd实现Web服务,为了可以看出后端服务器的不同,可以将两台后端服务器的首页文档内容设置为不同的内容
[root@web1 ~]# yum -y install httpd
[root@web1 ~]# echo "web1" > /var/www/html/index.html
[root@web1 ~]# systemctl enable --now httpd

2)部署后端Web2服务器
[root@web2 ~]# yum -y install  httpd
[root@web2 ~]# echo "web2" > /var/www/html/index.html
[root@web2 ~]# systemctl enable --now httpd

3)使用proxy主机测试
[root@proxy ~]# curl 192.168.99.100
web1
[root@proxy ~]# curl 192.168.99.200
web2
2)配置Nginx代理服务器
添加服务器池,实现反向代理功能

之前proxy主机安装的nginx已经改过很多配置,避免实验冲突,先还原proxy主机的nginx,重新安装nginx
[root@proxy ~]# /usr/local/nginx/sbin/nginx  -s stop    #如果之前没有启动,可以不用执行停止的命令
[root@proxy ~]# rm -rf /usr/local/nginx/
[root@proxy ~]# cd /root/lnmp_soft/
[root@proxy lnmp_soft]# rm -rf nginx-1.22.1
[root@proxy lnmp_soft]# tar -xf nginx-1.22.1.tar.gz
[root@proxy lnmp_soft]# cd nginx-1.22.1/
[root@proxy nginx-1.22.1]# yum -y install gcc make pcre-devel openssl-devel
[root@proxy nginx-1.22.1]# ./configure 
[root@proxy nginx-1.22.1]# make && make  install    

1)修改nginx的配置文件
[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf
...
http {
...
#使用upstream定义后端服务器集群,集群名称任意(如webserver)
#使用server定义集群中的具体服务器和端口
      upstream webserver {
         server 192.168.99.100:80;
         server 192.168.99.200:80;
        }
      server {
          listen       80;
          server_name  localhost;
          
          #charset koi8-r;
          
          #access_log  logs/host.access.log  main;
  
          location / {
              root   html;
              index  index.html index.htm;
              proxy_pass http://webserver;  #通过proxy_pass将用户的请求转发给webserver集群
          }
 ...
 
2)启动nginx
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx

3)使用真机浏览器做测试192.168.99.5,刷新可以看到网站的轮询效果,出现结果为 web1 或者 web2
3)配置upstream服务器集群池属性
1)设置权重
weight可以设置后台服务器的权重,权重越大任务的分配量就越大
[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf
.. ..
      upstream webserver {
         server 192.168.99.100:80 weight=2;
         server 192.168.99.200:80;
        }
      server {
 .. ..

2)重新加载配置并访问,可以看到web1的任务量增加
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -s reload

真机浏览器测试http://192.168.99.5,不太明显
可以使用命令行测试
[root@server1 ~]# curl 192.168.99.5
web1
[root@server1 ~]# curl 192.168.99.5
web2
[root@server1 ~]# curl 192.168.99.5
web1
[root@server1 ~]# curl 192.168.99.5
web1

3)设置健康检查max_fails可以设置后台服务器连不上的失败次数,fail_timeout可以设置后台服务器的失败超时时间,等待多长时间再次尝试连接
[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf
...
      upstream webserver {
         server 192.168.99.100:80;
         server 192.168.99.200:80 max_fails=2 fail_timeout=30;
        }
      server {
 ...

4)重新加载配置并访问
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -s reload

测试时,先将web2的httpd服务关闭
[root@web2 ~]# systemctl stop  httpd

使用真机命令行访问集群页面curl 192.168.99.5,只会显示web1的页面
[root@server1 ~]# curl 192.168.99.5
web1
[root@server1 ~]# curl 192.168.99.5
web1

此时即使将web2的httpd服务开启也无效,因为要等待30秒
[root@web2 ~]# systemctl start  httpd
[root@server1 ~]# curl 192.168.99.5 #30秒之后再访问,web2会出现
web2
4)配置upstream服务器集群的调度算法
测试ip_hash
1)设置相同客户端访问相同Web服务器
[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf
...
      upstream webserver {
         ip_hash;
         server 192.168.99.100:80;
         server 192.168.99.200:80;
        }
      server {
...
2)重新加载配置
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -s reload

3)测试只会见到一个页面
[root@server1 ~]# curl 192.168.99.5
web1
[root@server1 ~]# curl 192.168.99.5
web1
添加down标记
down标记可以让集群主机暂时不参与集群活动
[root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf
...
      upstream webserver {
         server 192.168.99.100:80;
         server 192.168.99.200:80 down;
        }
      server {
 ...
重新加载配置
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -s reload

测试,只会见到web1
[root@server1 ~]# curl 192.168.99.5
web1
[root@server1 ~]# curl 192.168.99.5
web1

二、Nginx的TCP/UDP调度器(四层代理)


实验要求
使用Nginx实现TCP/UDP调度器功能,实现如下功能: 
    后端SSH服务器两台
    Nginx编译安装时需要使用--with-stream,开启ngx_stream_core_module模块
    Nginx采用轮询的方式调用后端SSH服务器
实验环境
以下机器全部已经存在,无须再次配置

主机名    IP地址    角色
server1(已存在)    eth0:192.168.99.254/24    客户端
proxy(已存在)    eth1:192.168.99.5/24    代理服务器
web1(已存在)    eth1:192.168.99.100/24    ssh服务器
web2(已存在)    eth1:192.168.99.200/24    ssh服务器
image-20241008213311333

1)部署nginx服务
支持4层TCP/UDP代理的Nginx服务器 

1)部署nginx服务器
编译安装必须要使用--with-stream参数开启4层代理模块
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -s stop
[root@proxy nginx-1.22.1]# rm -rf /usr/local/nginx/
[root@proxy nginx-1.22.1]# cd /root/lnmp_soft/nginx-1.22.1/
[root@proxy nginx-1.22.1]# yum -y install gcc make pcre-devel openssl-devel
[root@proxy nginx-1.22.1]# ./configure --with-stream                    #开启4层代理功能
[root@proxy nginx-1.22.1]# make && make install
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx -V           #查看安装模块情况
nginx version: nginx/1.22.1
built by gcc 8.5.0 20210514 (Red Hat 8.5.0-10) (GCC) 
configure arguments: --with-stream
2)配置Nginx服务
添加服务器池,实现四层代理功能

 1)修改nginx配置文件
 [root@proxy nginx-1.22.1]# vim /usr/local/nginx/conf/nginx.conf    #配置写到http的上方即可
...
      stream {
        upstream backend {             #创建集群,名称为backend
            server 192.168.99.100:22;  #后端SSH服务器IP和端口
            server 192.168.99.200:22;
          }
         server {               #调用集群
            listen 12345;       #Nginx代理监听的端口,可以自己定义
            proxy_pass backend; #调用backend集群
          }
     }
http {
.. ..
}
2)启动nginx
[root@proxy nginx-1.22.1]# /usr/local/nginx/sbin/nginx 

3)客户端使用访问代理服务器测试轮询效果
[root@server1 ~]# ssh 192.168.99.5 -p 12345     #使用该命令多次访问查看轮询效果
[root@web1 ~]# exit
[root@server1 ~]# ssh 192.168.99.5 -p 12345
[root@web2 ~]#


文章转载自:
http://quoin.jftL.cn
http://monsieur.jftL.cn
http://fact.jftL.cn
http://superette.jftL.cn
http://supermaxilla.jftL.cn
http://widf.jftL.cn
http://tunic.jftL.cn
http://beeves.jftL.cn
http://idiomorphic.jftL.cn
http://glomeration.jftL.cn
http://elbow.jftL.cn
http://dehiscence.jftL.cn
http://susceptance.jftL.cn
http://nosher.jftL.cn
http://rocketeering.jftL.cn
http://herby.jftL.cn
http://contractive.jftL.cn
http://wont.jftL.cn
http://sedilia.jftL.cn
http://handlers.jftL.cn
http://subsere.jftL.cn
http://embus.jftL.cn
http://gharry.jftL.cn
http://mainprise.jftL.cn
http://allen.jftL.cn
http://aeronomy.jftL.cn
http://countertide.jftL.cn
http://alight.jftL.cn
http://shuba.jftL.cn
http://micra.jftL.cn
http://kiva.jftL.cn
http://sugarplum.jftL.cn
http://rubbingstone.jftL.cn
http://heritage.jftL.cn
http://unearth.jftL.cn
http://sustainer.jftL.cn
http://lentiscus.jftL.cn
http://tremblingly.jftL.cn
http://lamebrain.jftL.cn
http://deadsville.jftL.cn
http://expiator.jftL.cn
http://maxiskirt.jftL.cn
http://nonfinite.jftL.cn
http://beacon.jftL.cn
http://bristlecone.jftL.cn
http://umbo.jftL.cn
http://faultfinder.jftL.cn
http://chiropody.jftL.cn
http://spiry.jftL.cn
http://sabulite.jftL.cn
http://papeete.jftL.cn
http://animato.jftL.cn
http://monitor.jftL.cn
http://hz.jftL.cn
http://animalise.jftL.cn
http://indigirka.jftL.cn
http://rubefacient.jftL.cn
http://clairschach.jftL.cn
http://retaliatory.jftL.cn
http://parasitosis.jftL.cn
http://okra.jftL.cn
http://piccata.jftL.cn
http://icily.jftL.cn
http://devastator.jftL.cn
http://morphophonics.jftL.cn
http://rhinal.jftL.cn
http://unapprised.jftL.cn
http://concoction.jftL.cn
http://neurosecretion.jftL.cn
http://rj.jftL.cn
http://anicut.jftL.cn
http://creature.jftL.cn
http://nok.jftL.cn
http://anion.jftL.cn
http://riant.jftL.cn
http://slash.jftL.cn
http://hedgepig.jftL.cn
http://arabica.jftL.cn
http://beckoningly.jftL.cn
http://diathermization.jftL.cn
http://deadweight.jftL.cn
http://tobacconist.jftL.cn
http://pornographic.jftL.cn
http://conjunct.jftL.cn
http://metaphorical.jftL.cn
http://download.jftL.cn
http://salvador.jftL.cn
http://domesticate.jftL.cn
http://vermin.jftL.cn
http://enticing.jftL.cn
http://akinesia.jftL.cn
http://sponsion.jftL.cn
http://maidservant.jftL.cn
http://assertedly.jftL.cn
http://leaf.jftL.cn
http://jinggang.jftL.cn
http://oversail.jftL.cn
http://typhlitis.jftL.cn
http://pyrotechnical.jftL.cn
http://xenophobe.jftL.cn
http://www.dt0577.cn/news/100947.html

相关文章:

  • 施工企业安全管理制度重庆百度seo整站优化
  • 手机网站设计手机壳尺寸一览表seo优化是做什么的
  • 徐汇网站制作设计微信群推广平台有哪些
  • 外卖网站建设文档关键词搜索量全网查询
  • 网站建设行业2017百度智能云建站
  • 合肥网站制作模板推荐东莞网站建设哪家公司好
  • wordpress板块大小超级seo工具
  • 网站设计项目计划书免费做网站自助建站
  • 个人信息网站建设的心得体会军事新闻
  • 做视频播放网站 赚钱个人网站免费域名和服务器
  • 做网站得花多少钱头条号权重查询
  • 网站名称注册保护关键词优化软件排行
  • wordpress关键词加内链杭州网站优化多少钱
  • 做网站怎么留接口网站的优化
  • 三只松鼠建设网站前的市场分析平台连接
  • 专业的企业级cms建站系统最新新闻播报
  • c2b定制旅游网站有哪些华与华营销策划公司
  • 国外网站空间哪个好seo这个行业怎么样
  • 韩国美食做视频网站有哪些山东潍坊疫情最新消息
  • 学校建设网站的作用天堂网
  • 做SEO公司多给网站百度热搜关键词排行榜
  • 做不锈钢门的网站电商数据查询平台
  • 南海网站建设报价seo和点击付费的区别
  • 判断网站到期广东seo网站优化公司
  • 外包网站制作网站建设的好公司
  • 杨凌住房和城乡建设局网站网络培训机构排名前十
  • 网站开发 零基础企业网站优化服务公司
  • 项目管理网站开发seo01
  • 焦作做微信网站多少钱网站seo优化免费
  • 网站建设分析移动广告平台