httpd-vhosts.conf多虚拟主机配置
httpd.conf修改
开启
# Virtual hosts
Include conf/extra/httpd-vhosts.conf 此行#号去掉
修改httpd-vhosts.conf为
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin yt5538528@163.com
DocumentRoot "F:\yt\wamp\www1"
ServerName happy.l
ServerAlias happy.l
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" combined
<Directory "F:\yt\wamp\www1">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
|
修改
C:\Windows\System32\drivers\etc\hosts 文件
增加
127.0.0.1 happy.l
最后重启APACHE服务 就可以访问啦
