1.先安装好xamp环境并启动,打开配置文件httpd.conf,搜 httpd-vhosts.conf
Include conf/extra/httpd-vhosts.conf //去掉前面的#,这样就开启了httpd-vhosts虚拟主机模块
<Directory />
Options FollowSymLinks ExecCGI Indexes
AllowOverride none
Require all denied
</Directory>
2.打开扩展配置文件 \conf\extra httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "E:/www"
ServerName www.max.com
ServerAlias *.max.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
3.打开本地 C:\Windows\System32\drivers\etc hosts 复制出来修改后再覆盖
127.0.0.1 www.max.com
网友评论