Django on apache wtih mod_wsgi (Linux) - 403 Forbidden

后端 未结 3 1241
轻奢々
轻奢々 2021-01-19 04:37

Alright, so i am following this tutorial. When i try to access my site through my local server i get this peculiar error:

Forbidden You don\'t have per

3条回答
  •  再見小時候
    2021-01-19 05:02

    A things to start with:

    WSGIScriptAlias / /home/nick/Mysite/mysite.wsgi
    

    For this, you do not have a corresponding:

    
    
    Require all granted
    
    
    

    Also, a home directory such as /home/nick is usually not readable to other users and so Apache wouldn't be able to read stuff in that directory anyway.

    Next is:

    Alias /static /var/www/mysite/static/
    

    You shouldn't have a trailing slash on final path. Not having them matched when for a sub URL can cause issues, although usually when the trailing slash is on the URL and missing for the file system path. Better just to have them match as far as whether a trailing slash is used or not.

提交回复
热议问题