纳速健身

标题: phpstudy本地配置虚拟主机教程You don't have permission to access解决 [打印本页]

作者: awagink    时间: 2014-9-6 17:54
标题: phpstudy本地配置虚拟主机教程You don't have permission to access解决
首先有两种情况导致该问题产生,

第一种情况,没有选择面板中的【其他选项菜单】-【phpstudy设置】-【允许目录列表】如图所示。
以下是官方给出的解答。
新版phpStudy为了安全,取消Apache和nginx列出目录内容。
phpStudy如何禁止或允许站点目录列表
请使用『其他选项菜单』-『phpStudy设置』-『允许目录列表』,打上对勾表示允许目录列表,去掉对勾表示禁止目录列表。

(, 下载次数: 4)


第二种情况,配置多域名的虚拟主机。
今天安装了phpstudy本地配置多域名的虚拟主机时候总是失败,提示You don't have permission to access / on this server。
找了很多方法都没有解决,包括修改配置文件代码。


Conf代码


将之修改为

Conf代码



修改后仍不可用,
最后看到phpStudy使用手册中的如何添加多站点,通过使用phpStudy界面的『其他选项菜单』-『站点域名管理』按钮方式进行设置,设置后正确配置虚拟主机。

配置后找到配置文件目录下的vhosts文件查看,原来添加了如下代码,经测试,直接添加如下代码也可用。


  1. DocumentRoot "D:asuewww"
  2.   
  3.     Options -Indexes +FollowSymLinks +ExecCGI
  4.     AllowOverride All
  5.     Order allow,deny
  6.     Allow from all
  7.     Require all granted
  8.   




  9.     DocumentRoot "D:myenvasuewwwasuepublic"
  10.     ServerName nasue.com
  11.     ServerAlias nasue.com
  12.   
  13.       Options FollowSymLinks ExecCGI
  14.       AllowOverride All
  15.       Order allow,deny
  16.       Allow from all
  17.       Require all granted
  18.   




  19.     DocumentRoot "D:wwwasuepublic"
  20.     ServerName nasue.com
  21.     ServerAlias nasue.com
  22.   
  23.       Options FollowSymLinks ExecCGI
  24.       AllowOverride All
  25.       Order allow,deny
  26.       Allow from all
  27.       Require all granted
  28.   
复制代码

以下是官方给出的解答:
phpStudy如何添加多站点,站点域名设置
请使用『其他选项菜单』-『站点域名管理』。







欢迎光临 纳速健身 (https://www.nasue.com/) Powered by Discuz! X3.4