由于更新到高塞拉利昂,本地主机上出现错误403 Apache

时间:2018-07-03 12:18:51

标签: laravel macos apache localhost

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

运行此命令时:

const item = require('../my-module/items/item');

它向我返回此错误:

apachectl configtest

所以我签入/ ect / hosts

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

似乎还可以 我尝试在此文件“ /private/etc/apache2/extra/httpd-userdir.conf”中取消注释,然后重新启动apache服务

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
~   

即使我尝试http://localhost,我也有禁止访问的页面

我不需要寻找...

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

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

1 个答案:

答案 0 :(得分:0)

我的解决方法是:

  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