Apache2.4.6添加虚拟主机提示:NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/extra/httpd-vhosts.conf
2016-07-04 10:04:10;  来源:追太阳;  作者:;  评论:0 点击:

[root@localhost conf] service httpd restart停止 httpd:
[root@localhost conf]# service httpd restart
停止 httpd:                                               [确定]
启动 httpd:AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/extra/httpd-vhosts.conf:1

文件 /usr/local/apache/conf/extra/httpd-vhosts.conf 的内容如下:

NameVirtualHost *:80
<virtualhost *:80>
  ServerName www.example.com
  DocumentRoot /var/www
  DirectoryIndex index.html index.php
  <Directory /var/www>
    Options +Includes -Indexes
    AllowOverride All
    Order Deny,Allow
    Allow from All
    php_admin_value open_basedir /var/www:/tmp:/proc
  Directory>
virtualhost>

Include conf/vhost/*

提示很明显 NameVirtualHost 已经无效,所以配置虚拟主机时不需要设置NameVirtualHost ,把上面的 “ NameVirtualHost *:80 ” 删除掉,问题解决!

本文属转载文章,并不能保证完全正确,只供学习交流参考,版权归原作者所有。如果您认为有侵犯权利等不和法行为,请联系我们及时改正。

相关热词搜索:Apache 虚拟主机 NameVirtualHost

上一篇:网页head中的内容跑到body里了页面显示不正常解决办法
下一篇:安装XAMPP时启动Apache失败解决方法 xampp-win32-1.8.3-1-VC11-installer

收藏
回到顶部