去掉#
[root@lizhipenglinux01 ~]# /usr/local/apache2.4/bin/apachectl restart
httpd not running, trying to start
[root@lizhipenglinux01 ~]# /usr/local/apache2.4/bin/apachectl stop
[root@lizhipenglinux01 ~]# /usr/local/apache2.4/bin/apachectl start
删除以后不通了
[root@lizhipenglinux01 ~]# /usr/local/apache2.4/bin/apachectl -t 检查配置文件语法是否对
Syntax OK
[root@lizhipenglinux01 ~]# /usr/local/apache2.4/bin/apachectl graceful 重新加载配置文件,并不会重启服务
[root@lizhipenglinux01 ~]# vim /usr/local/apache2.4/conf/extra/httpd-vhosts.conf
[root@lizhipenglinux01 ~]# /usr/local/apache2.4/bin/apachectl -t
Syntax OK
[root@lizhipenglinux01 ~]# /usr/local/apache2.4/bin/apachectl graceful
[root@lizhipenglinux01 ~]# curl -x192.168.5.128:80 abc.com
abc.com[root@lizhipenglinux01 ~]# curl -x192.168.5.128:80 www.abc.com
abc.com[root@lizhipenglinux01 ~]# curl -x192.168.5.128:80 www.abcd.com
abc.com[root@lizhipenglinux01 ~]# curl -x192.168.5.128:80 www.abcde.com
abc.com[root@lizhipenglinux01 ~]# curl -x192.168.5.128:80 www.example.com
111.com[root@lizhipenglinux01 ~]#