Nginx虚拟主机
报错解决:
基于端口
[root@localhost ~]# cd /etc/nginx/conf.d
a.conf
b.conf
c.conf
创建网站发布目录
测试访问(另一台或者在网页访问)
基于IP
vim a.conf
server{
listen 192.168.142.98:83;
server_name localhost;
location / {
root /web3;
index index.html;
}
}
vim b.conf 、c.conf都改为端口80
nginx -s reload
ss -antpl
验证:
基于域名(略)
验证
Nginx Proxy代理
226:web服务器
227:代理服务器
proxy
二:Nginx负载均衡
作用:接收用户请求转给web服务器
(最新版本)
验证负载均衡功能
web-1
web-2
负载均衡227
xingdian为地址池
重启服务
验证
NFS:
yum -y install nfs-utils
systemctl start nfs
[root@mysql-slave ~]# mkdir /opt/nfs
[root@mysql-slave ~]# vim /etc/exports
/opt/nfs *(rw,sync,no_root_squash)
[root@mysql-slave ~]# exportfs -rv
[root@mysql-slave ~]# cp -r jspvz/* /opt/nfs/
[root@mysql-slave ~]# ls /opt/nfs/
audio favicon.ico g.css images index.html js level music process.htm
客户机
[root@localhost ~]# mount -t nfs 192.168.142.145:/opt/nfs /usr/share/nginx/html/