【问题标题】:Web cannot access the root directory of apache virtual hostweb无法访问apache虚拟主机的根目录
【发布时间】:2014-06-18 20:23:59
【问题描述】:

我正在运行 apache。我有一个名为 mis.chaatz.com 的虚拟主机。但是,如果我输入 mis.abc.com。它返回“禁止您无权访问/在此服务器上”。但是,如果我输入 mis.abc.com/login,它可以重新打开网页。我想我的 apache 配置有问题。试一整天,没有运气。

配置如下:

我在 /windows/system32/drivers/etc 中有一个主机文件

127.0.0.1 mis.abc.com

httpd.conf如下:

<Directory />
  AllowOverride All
  Require all granted
  Allow from all
</Directory>

DocumentRoot "c:/Apache24/htdocs"

<Directory "c:/Apache24/htdocs">
  Options FollowSymLinks
  AllowOverride All
  Require all granted
</Directory>  

<IfModule dir_module>
  DirectoryIndex index.html
</IfModule> 

# the following the document root of the mis.chaatz.com 

<Directory "C:\apache24\htdocs\new_project\laravel\public\laravel1\public">
    AllowOverride all
    Require all granted
Allow from all
</Directory>

而httpd-vhosts的配置如下:

 <VirtualHost *:80>
  DocumentRoot "C:\apache24\htdocs\new_project\laravel\public\laravel1\public"
  ServerName mis.abc.com    
 </VirtualHost>   

【问题讨论】:

    标签: apache laravel-4


    【解决方案1】:

    我使用以下在 Mac OSX 上一直对我有用的东西。我根本没有配置httpd.conf。我模糊记得的是,Apache 读取路径中的正斜杠,而您有反斜杠。我会说在没有您所做的httpd.conf 编辑的情况下尝试一下。

    <VirtualHost *:80>
       DocumentRoot C:/apache24/htdocs/new_project/laravel/public/laravel1/public
       ServerName mis.abc.com   
    </VirtualHost>
    

    【讨论】:

    • 您好,经过一步一步的跟踪。我终于发现这个配置中存在问题。 DirectoryIndex index.html 如果我将 index.html 更改为上面的 index.php。那么问题就解决了。
    猜你喜欢
    • 1970-01-01
    • 2014-07-08
    • 2021-04-30
    • 1970-01-01
    • 2016-10-05
    • 1970-01-01
    • 2023-03-17
    • 2012-01-27
    • 2015-12-03
    相关资源
    最近更新 更多