Apache配置本地域名访问

1.先安装好xamp环境并启动,打开配置文件httpd.conf,搜 httpd-vhosts.conf

Include conf/extra/httpd-vhosts.conf //去掉前面的#,这样就开启了httpd-vhosts虚拟主机模块


Options FollowSymLinks ExecCGI Indexes
AllowOverride none
Require all denied

2.打开扩展配置文件 \conf\extra httpd-vhosts.conf


ServerAdmin [email protected]
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

3.打开本地 C:\Windows\System32\drivers\etc hosts 复制出来修改后再覆盖

127.0.0.1 www.max.com

你可能感兴趣的:(Apache配置本地域名访问)