dreamflycc

步骤如下:

1.在配置文件httpd.conf中启用httpd-vhosts.conf

找到# Virtual hosts将Include conf/extra/httpd-vhosts.conf前的#去掉。

2.假设虚拟主机在f:/myblog(事先要存在该站点,可以是虚拟目录,可以是apache的站点文件)

3.设置httpd-vhosts.conf文件

#配置虚拟主机
<VirtualHost 127.0.0.1:80>
    DocumentRoot "f:/myblog"
    #配置欢迎页
    DirectoryIndex index.php index.html index.htm
    <Directory />
    Options FollowSymLinks
    #访问权限设置
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
</VirtualHost>

4.修改hosts文件。添加ip和主机映射关系

C:\Windows\System32\drivers\etc\hosts.

添加本机ip      域名

分类:

技术点:

相关文章:

  • 2022-01-01
  • 2021-05-02
  • 2021-07-19
  • 2021-10-23
  • 2021-10-05
  • 2021-06-11
猜你喜欢
  • 2021-12-25
  • 2021-09-24
  • 2021-11-09
相关资源
相似解决方案