一、修改httpd.conf文件

编辑配置文件:
目录:%xampp\apache\conf\httpd.conf

#确认以下是否开启

Include conf/extra/httpd-vhosts.conf

#修改<Directory />参数

<Directory />
    #AllowOverride none
    #Require all denied
    Options All
    AllowOverride All
    Require all granted
</Directory>

#配置文本最后加入:
<Directory "D:/web/web1">
  Options Indexes FollowSymLinks Includes ExecCGI
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>
<Directory "D:/web/web2">
  Options Indexes FollowSymLinks Includes ExecCGI
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>

二、配置虚拟目录

编辑配置文件:
目录:%xampp\apache\conf\extra\httpd-vhosts.conf

#加入以下内容:
<VirtualHost *:80>
    ServerAdmin web1@dummy-host2.example.com
    DocumentRoot "D:/web/web1"
    ServerName www.web1.com
    ErrorLog "logs/web1-error.log"
    CustomLog "logs/web1-access.log" common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin web2@dummy-host2.example.com
    DocumentRoot "D:/web/web2"
    ServerName www.web2.com
    ErrorLog "logs/web2-error.log"
    CustomLog "logs/web2-access.log" common
</VirtualHost>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-01-07
  • 2021-09-15
  • 2021-10-10
  • 2021-10-28
猜你喜欢
  • 2022-01-01
  • 2021-12-07
  • 2021-06-25
  • 2022-12-23
  • 2021-12-15
  • 2022-01-01
相关资源
相似解决方案