nginx的负载均衡

nginx的负载均衡

1.以多台虚拟机作服务器

1.1 在不同的虚拟机上安装httpd服务

我这里采用3台虚拟机分别建立3台服务器:192.168.32.137、192.168.32.138、192.168.32.147。

在3台虚拟机服务器上安装httpd服务

#使用yum安装httpd服务
[root@node0-8 /]# yum install httpd -y

#开启httpd服务
[root@node0-8 /]# systemctl start httpd
[root@node0-8 /]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           └─php-fpm.conf
   Active: active (running) since Mon 2022-12-05 23:34:13 CST; 8 months 7 days ago
1.2 在不同虚拟机所构建的服务端的默认路径下创建不同标识的文件
#查看httpd的配置文件所指向的网站主页文件路径
[root@node0-8 /]# vim /etc/httpd/conf/httpd.conf
</Directory>

# Further relax access to the default document root:
<Directory "/var/www/html">

#在/var/www/html路径下创建index.html文件,文件内容标识不同的服务器端
#在
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值