Fixing 403 Forbidden on alias directory with Apache

后端 未结 11 1233
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 14:35

I am trying to setup an alias to point to some directory on my filesystem not in DocumentRoot. Now I get a 403 Forbidden response. These are the steps taken: 1. edit http.co

11条回答
  •  情歌与酒
    2020-12-08 14:46

    After lots of time waste i fixed the issue and i wanted to share to save your time.

    All the gentelmen above and on other posts has some correct parts in their answers but below is the sum

    In your "/etc/apache2/httpd.conf" file:

    1- change your document root

    Original: DocumentRoot "/Library/WebServer/Documents"
    Change to: DocumentRoot "/Users/yourname/www"
    

    2- change

    Original:

    
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
    
    

    Change to:

    
        Options FollowSymLinks Includes ExecCGI
        AllowOverride None
        Order deny,allow
        Deny from all
    
    

    3- Change:

    Original:

    
    

    Change to:

    
    

    4- Finally, you might not need this step if you are the supper user, this is to set the right permition on your new root folder

    chmod 755 /Users/yourname/www
    

    Hope this will help

提交回复
热议问题