APACHE 2.4.33 配置

2018-12-18  本文已影响0人  AnnaJIAN

Forbidden

You don't have permission to access / on this server.
重启apache并查看报错
Anna🔥~/Sites/Local $ sudo apachectl -k restart
查看httpd.conf的配置
去掉
<Directory />
    AllowOverride none
    Require all denied
</Directory>
释放掉 LoadModule rewrite_module libexec/apache2/mod_rewrite.so 的注释
释放掉 Include /private/etc/apache2/extra/httpd-vhosts.conf 的注释
释放掉 LoadModule php7_module libexec/apache2/libphp7.so 的注释 #php开发
虚拟机的配置
Anna🔥/etc/apache2/other $ ls
localhost.conf php7.conf
<VirtualHost *:80>
    ServerAdmin anna@localhost.com
    DocumentRoot "/Users/Anna/Sites/Local"
    # Set access permission
    <Directory "/Users/Anna/Sits/Local">
        DirectoryIndex index.php
        Require all granted
    </Directory>
    ServerName localhost.com
    ErrorLog "/private/var/log/apache2/anna.localhost.com-error_log"
    CustomLog "/private/var/log/apache2/anna.localhost.com-access_log" common
</VirtualHost>
hosts, 重启。
127.0.0.1 localhost.com

https://blog.csdn.net/u010014161/article/details/81218673

上一篇下一篇

猜你喜欢

热点阅读