windows使用apache2.4配置虚拟域名

ccforevercn<1253705861@qq.com> 2021-03-19 16:38:20

打开配置文件httpd.conf

安装路径/conf/httpd.conf

Include conf/extra/httpd-vhosts.conf
LoadModule rewrite_module modules/mod_rewrite.so

修改hosts文件 C:WindowsSystem32driversetc

127.0.0.1  www.aaaa.net(访问的域名)

设置域名对应的物理路径

安装路径/conf/extra/httpd-vhosts.conf

文件尾部追加

 
DocumentRoot  "d:/file"   # 文件物理地址
ServerName  www.aaaa.net #(访问的域名和hosts文件中的域名一致)
 
  # 文件物理地址
    Require all granted  # 文件权限

启动apache

httpd.exe -k start

重启apache

httpd.exe -k restart
上一篇: apaceh2.4转发php-fpm
下一篇: 重定向
相关文章
返回顶部小火箭