编辑vhosts文件:/alidata/server/httpd-2.4.10/conf/extra/httpd-vhosts.conf
<VirtualHost *:80><Location />Order deny,allowDeny from all</Location></VirtualHost><VirtualHost *:80>DocumentRoot /alidata/www/abcServerName abc.comServerAlias www.abc.com<Directory "/alidata/www/abc"> ???Options FollowSymLinks ???AllowOverride all ???Order allow,deny ???Allow from all</Directory>ErrorLog "/alidata/log/httpd/abc-error.log"CustomLog "/alidata/log/httpd/abc.log" common</VirtualHost>
注意两点:
1. 如果通过服务器ip进行访问,则默认会进入第一个web目录“abc”
2. 必须在最开始的位置,设置web根目录(www)的访问权限,否则很不安全
;
apache vhosts 虚拟主机设置
原文地址:http://www.cnblogs.com/upup2015/p/apache.html