SASAOO

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 29|回复: 0

Apache2.4.6添加虚拟主机提示:NameVirtualHost has no effect

[复制链接]

22

主题

28

帖子

112

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
112
发表于 2019-7-8 15:35:27 | 显示全部楼层 |阅读模式
Apache2.4.6添加虚拟主机提示:NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/extra/httpd-vhosts.conf
  1. [root@localhost conf]# service httpd restart
  2. 停止 httpd:                                               [确定]
  3. 启动 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 的内容如下:


  1. NameVirtualHost *:80
  2. <virtualhost *:80>
  3.     ServerName www.example.com
  4.     DocumentRoot /var/www
  5.     DirectoryIndex index.html index.php
  6.     <Directory /var/www>
  7.         Options +Includes -Indexes
  8.         AllowOverride All
  9.         Order Deny,Allow
  10.         Allow from All
  11.         php_admin_value open_basedir /var/www:/tmp:/proc
  12.     </Directory>
  13. </virtualhost>

  14. Include conf/vhost/*
复制代码


提示很明显 NameVirtualHost 已经无效(指的是Apache2.4.x版本),所以配置虚拟主机时不需要设置 NameVirtualHost,把上面的 “NameVirtualHost *:80” 删除掉,问题解决!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|SASAOO.

GMT+8, 2019-7-24 18:02 , Processed in 0.093751 second(s), 32 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表