xmapp 403 与 多站点

假如想象 提交于 2020-02-21 09:44:55

1、首先多站点:配置的路径不一样 也可以,配置新端口也可以。

在/Applications/XAMPP/xamppfiles/apache2/conf/httpd.conf 中,添加:

listen 8081

  

然后在/Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf中添加

<VirtualHost *:80>
    DocumentRoot "/Users/houzhibin/javaself/code/php/shop/crmeb3/public"
<Directory "/Users/houzhibin/javaself/code/php/shop/crmeb3/public">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
    ServerAlias crmeb3.demo.com
    ErrorLog "logs/dummy-host.example.com-error_log"
    CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerName api.qiushi.com
    DocumentRoot "/Users/houzhibin/javaself/code/php/qiushi/public"
<Directory "/Users/houzhibin/javaself/code/php/qiushi/public">
    Options FollowSymLinks ExecCGI
      #是否显示列表 (在发布项目后一般是不启用,对于这个配置,针对DocumentRoot在apachede的默认文件夹外的目录生效 )
      Options +indexes
      AllowOverride All
      Order allow,deny
      Allow from all
      #Deny from all
      Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:8081>
    DocumentRoot "/Users/houzhibin/javaself/code/php/qiushi/public"
    ServerAlias api.qiushi.com:8081
    <Directory "/Users/houzhibin/javaself/code/php/qiushi/public">
    Options FollowSymLinks ExecCGI
      #是否显示列表 403解决(在发布项目后一般是不启用,对于这个配置,针对DocumentRoot在apachede的默认文件夹外的目录生效 )
      Options +indexes
      AllowOverride All
      Order allow,deny
      Allow from all
      #Deny from all
      Require all granted
</Directory>
    ErrorLog "logs/api.qiushi.com-error_log"
    CustomLog "logs/api.qiushi.com.-access_log" common
</VirtualHost>

  

 

好使了之后:

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!