【问题标题】:Error 403 apache on localhost since update to high sierra自更新到高山脉以来,本地主机上的错误 403 apache
【发布时间】:2018-12-11 18:18:17
【问题描述】:

我有一个问题,因为我将 macOS X 更新到高 sierra 版本我在运行 apache 服务时遇到了一些问题。当我尝试在本地访问此 url http://social.demo 时,我有禁止页面 social.demo 是一个使用 Laravel 制作的项目

当运行这个命令时:

apachectl configtest

它返回给我这个错误:

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Alexiss-iMac.local. Set the 'ServerName' directive globally to suppress this message
Syntax OK

所以我签入 /ect/hosts

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
127.0.0.1 api.demo
127.0.0.1 tv.demo
127.0.0.1 bo.demo
127.0.0.1 social.demo
127.0.0.1 website.demo
127.0.0.1 revive.demo
127.0.0.1 bo.demo
~   

好像没问题 我尝试在此文件“/private/etc/apache2/extra/httpd-userdir.conf”中取消注释并重新启动apache服务

#Include /private/etc/apache2/users/*.conf

即使我尝试http://localhost我也有一个禁止页面

我不用去哪里找……

编辑:这里是我的 httpd-vhost.conf

<VirtualHost *:80>
DocumentRoot "/Users/alexisjqn//Documents/Ctor/public/"
ServerName http://social.demo/
SetEnv APPLICATION_ENV "development"
     <Directory "/Users/alexisjqn//Documents/Ctor/public/">
         DirectoryIndex index.php
         AllowOverride All
         Require all granted
         Order allow,deny
         Allow from all
     </Directory>
</VirtualHost>

【问题讨论】:

  • 不确定,但您可以检查文件/目录权限。
  • @ab_ab 我将 /Library/WebServer/Documents/index.html.en 放在 777 中,并带有 chown root 但同样的问题...
  • 我的意思是storageDirectory Permissionsbootstrap/cache
  • @ab_ab drwxrwxrwx 6 位 alexisjqn 员工负责这两个文件夹
  • 权限问题是我的随机猜测。我对这方面了解不多。看看this。它可能会对你有所帮助。

标签: laravel macos apache localhost


【解决方案1】:

我的解决方法如下:

  1. 请检查“/private/etc/apache2/extra/httpd-userdir.conf”文件。改变

    #Include /private/etc/apache2/users/*.conf
    

    Include /private/etc/apache2/users/*.conf
    
  2. 并编辑您的“/etc/apache2/httpd.conf”

    改变

    Options FollowSymLinks Multiviews
    

    Options FollowSymLinks Multiviews Indexes
    

    您的文档根目录最终将如下所示,

    DocumentRoot "/Library/WebServer/Documents"
    <Directory "/Library/WebServer/Documents">
    Options FollowSymLinks Multiviews Indexes
    MultiviewsMatch Any
    AllowOverride All
    Require all granted
    
  3. 重启apache

    sudo apachectl restart
    

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-07
    • 1970-01-01
    • 2020-02-09
    • 1970-01-01
    • 2013-06-05
    相关资源
    最近更新 更多