PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > 服务器 > Web服务器 > 正文

    wampserver本地域名配置(域名绑定)教程

    作者:admin来源:网络浏览:时间:2020-09-30 00:07:50我要评论
    导读:在做项目的时候,想在本地配置虚拟域名来运行程序,这样做好直接上传线上会省事一下,本地使用的是wampserver集成环境,下面具体来说一下配...
    在做项目的时候,想在本地配置虚拟域名来运行程序,这样做好直接上传线上会省事一下,本地使用的是wampserver集成环境,下面具体来说一下配置教程。

    第一步:找到F:\wamp\bin\apache\apache2.4.9\conf\httpd.conf  这个文件里的Include conf/extra/httpd-vhosts.conf
    把前面的#去掉

    在找到下面的代码,大概在240行左右

    <Directory />
        AllowOverride none
        Require all denied
    </Directory>
     
    替换成如下代码

    <Directory />
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
    #    Deny from all
        Allow from all
     
    #允许所有访问
        Satisfy all
    </Directory>

    修改完后,保存文件

    第二步:找到文件F:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf 添加下面代码

    <VirtualHost *:80>
        DocumentRoot "D:\wamp\www-D" //程序文件目录
        ServerName  www.bcty365.com  //需要配置的域名
        ServerAlias bcty365.com
      <Directory "D:\wamp\www-D">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
      </Directory>
    </VirtualHost>
    配置好以后,保存,重启wampserver服务

    第三步: 修改本地的hosts 文件,把域名配置进去

    这样就搞定了。
    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-122-4995-1.html
    相关热词搜索: