Apache2.4.6添加虛擬主機提示:NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/extra/httpd-vhosts.conf


[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 已經無效(指的是Apache2.4.x版本),所以配置虛擬主機時不需要設置 NameVirtualHost,把上面的 “NameVirtualHost *:80” 刪除掉,問題解決!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM