zoukankan      html  css  js  c++  java
  • mac osx Forbidden You don't have permission to access / on this server解决方法

    (1)首先查看*.conf 是否有读写权限,如果没有要将文件赋予读写权限,比如

    sudo chmod 777 localhost.conf

    (2)再查看/Users/username/Sites/localhost/文件夹是否有index.html文件,没有的话,创建一个,默认是打开index.html文件

    (3)最后查看localhost配置文件

    对于OSX 10.9 Apache 2.2

    <VirtualHost *:80>
        DocumentRoot "/Users/xx/Sites/localhost"
        ServerName localhost
        ErrorLog "/Users/xx/Sites/logs/localhost-error_log"
        CustomLog "/Users/xx/Sites/logs/localhost-access_log" common
        <Directory "/Users/xx/Sites/localhost">
                Order deny,allow
                Allow from all
        </Directory>
    </VirtualHost>

    对于OSX 10.10 Apache 2.4

    <VirtualHost *:80>
        DocumentRoot "/Users/xx/Sites/localhost"
        ServerName localhost
        ErrorLog "/Users/xx/Sites/logs/localhost-error_log"
        CustomLog "/Users/xx/Sites/logs/localhost-access_log" common
        <Directory "/Users/xx/Sites/localhost">
                Require all granted    
        </Directory>
    </VirtualHost>        

    (4)最后重启apache

     sudo apachectl restart
  • 相关阅读:
    SQLi-Labs
    ASP.NET 简介
    CSS
    Apache 基本配置
    【Windows 基础】 01
    sqli1-4
    SQL注入介绍(本文更新中)
    【DC-1】靶机实战
    常见端口的漏洞总结
    element ui table动态控制某列展示与否,并且该列使用了fixed,导致列表错位问题
  • 原文地址:https://www.cnblogs.com/xiongqiangcs/p/4220134.html
Copyright © 2011-2022 走看看