美文网首页
Apache配置本地域名访问

Apache配置本地域名访问

作者: Yumazhiyao | 来源:发表于2018-07-17 10:00 被阅读12次

    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

    相关文章

      网友评论

          本文标题:Apache配置本地域名访问

          本文链接:https://www.haomeiwen.com/subject/ufkwpftx.html