- 工信部备案号 滇ICP备05000110号-1
- 滇公网安备53011102001527号
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
- CN域名投诉举报处理平台:电话:010-58813000、邮箱:service@cnnic.cn
yum install -y epel-* yum isntall -y nginx vim
mkdir /var/wwwroot mkdir /var/wwwroot/site1 mkdir /var/wwwroot/site2 echo -e "site1" >> /var/wwwroot/site1/index.html echo -e "site2" >> /var/wwwroot/site2/index.html

setenforce 0 systemctl stop firewalld systemctl disable firewalld

vim /etc/nginx/conf.d/vhosts.conf
server {
listen 8081;
root /var/wwwroot/site1;
index index.html;
location / {
}
}
server {
listen 8082;
root /var/wwwroot/site2;
index index.html;
location / {
}
}
nginx服务systemctl start nginx
http://www.landui.com:8081/http://www.landui.com:8082/

vim /etc/nginx/conf.d/vhosts.conf
server {
listen 80;
server_name site1.test.com;
root /var/wwwroot/site1;
index index.html;
location / {
}
}
server {
listen 80;
server_name site2.test.com;
root /var/wwwroot/site2;
index index.html;
location / {
}
}
nginx服务systemctl restart nginx
hosts文件编辑C:\Windows\System32\drivers\etc\hosts文件,
添加以下内容(根据实际情况自己修改)
192.168.204.135 site1.test.com 192.168.204.135 site2.test.com

http://www.landui.com/http://www.landui.com/


ifconfig ens33:1 192.168.204.151 ifconfig ens33:2 192.168.204.152
vim /etc/nginx/conf.d/vhosts.conf
server {
listen 192.168.204.151:80;
root /var/wwwroot/site1;
index index.html;
location / {
}
}
server {
listen 192.168.204.152:80;
root /var/wwwroot/site2;
index index.html;
location / {
}
}
nginx服务systemctl restart nginx
http://www.landui.com/http://www.landui.com/

售前咨询
售后咨询
备案咨询
二维码

TOP