三、基于ip虚拟主机的配置
[root@localhost ~]# ifconfig eth0:0 192.168.2.200
[root@localhost ~]# mkdir /tec
[root@localhost ~]# echo "tec ip xu ni zhu ji" > /tec/index.html
[root@localhost ~]# mkdir /mkt
[root@localhost ~]# echo "mkt ip xu ni zhu ji" > /mkt/index.html
编辑nginx主配置文件

[root@localhost ~]# pkill -9 nginx
[root@localhost ~]# nginx
修改hosts文件

客户端测试


四、基于名字虚拟主机配置
编辑nginx主配置文件

[root@localhost ~]# pkill -9 nginx
[root@localhost ~]# nginx
修改hosts文件

客户端测试


nginx基本部分应用配置完毕,接下来的学习可谓任重而道远!!!
