(1)启用 httpd-vhosts.conf
在 httpd.conf 文件中
# Virtual hosts ,虚拟主机
#Includeconf/extra/httpd-vhosts.conf 中,将该行的#去掉,进行启用。
(2)
apache\conf\extra
httpd-vhosts.conf在该文件最下方进行配置:
<VirtualHost 127.0.0.1:82>
DocumentRoot "E:\eclipse-php-luna-SR1a-win32\workspace"
#这里配置欢迎首页面
DirectoryIndex index.html index.htm index.php
<Directory />
Options FollowSymLinks
#不许可别人修改我们的页面
AllowOverride None
#设置访问权限
Order allow,deny
Allow from all
Require all granted //注意apache2.4版本需要在此添加此句,血泪般的教训
</Directory>
</VirtualHost>