一、下载nginx\n\nyum install nginx\n\n
二、配置\n\nvim /etc/nginx/nginx.conf\n\n
三、加载配置\n\nsystemctl start nginx\n\nps -aux |grep nginx\n\n
四、多IP手动设置\n\nnmtui\n\n\n\n
五、配置nginx\n\nvim /etc/nginx/conf.d/test_ip.conf\n\ncat /etc/nginx/conf.d/test_ip.conf\n\nserver{\n listen 192.168.117.128:80;\n root /www/ip/130;\n location / {\n index index.html;\n }\n}\n \nserver{\n listen 192.168.117.100:80;\n root /www/ip/100;\n location / {\n index index.html;\n }\n}\n \nserver{\n listen 192.168.117.200:80;\n root /www/ip/200;\n location / {\n index index.html;\n }\n}\n\n
六、创建目录\n\nmkdir /www/ip/{128,100,200} -pv\n\necho this is 128 > /www/ip/128/index.html\necho this is 100 > /www/ip/100/index.html\necho this is 200 > /www/ip/200/index.html\n\n
七、重启\n\nsystemctl restart nginx\n\ncurl 192.168.117.128\n\nthis is 128\n \n\ncurl 192.168.117.200\n\nthis is 200\n\ncurl 192.168.117.100\n\nthis is 100\n\n服务器