虚拟主机
配置环境
[root@localhost ~]#cd /var/www/html/
[root@localhost html]#mkdir 123
[root@localhost html]#mkdir abc
[root@localhost html]#ls
123 abc
[root@localhost html]#cd 123/
[root@localhost 123]#echo 123 > index.html
[root@localhost 123]#cd ../abc/
[root@localhost abc]#echo abc > index.html
[root@localhost abc]#cat index.html
abc
[root@localhost abc]#cd ../123/
[root@localhost 123]#cat index.html
123
[root@localhost 123]#systemctl restart httpd
一、 基于IP
[root@localhost ~]#vim /etc/httpd/conf.d/test.conf
二、基于端口
[root@localhost ~]#vim /etc/httpd/conf.d/test.conf
[root@localhost ~]#vim /etc/httpd/conf/httpd.conf
三、基于域名
[root@localhost ~]#vim /etc/httpd/conf.d/test.conf
[root@centos7-2 ~]#vim /etc/hosts