Apache: “AuthType not set!” 500 Error

后端 未结 6 1052
独厮守ぢ
独厮守ぢ 2021-01-30 02:10

It\'s been a while since I used the Apache httpd web server. I\'m firing up a local server for a project and when I try to request localhost/index.html, I get a 500 error and I

6条回答
  •  广开言路
    2021-01-30 02:44

    The problem here can be formulated another way: how do I make a config that works both in apache 2.2 and 2.4?

    Require all granted is only in 2.4, but Allow all ... stops working in 2.4, and we want to be able to rollout a config that works in both.

    The only solution I found, which I am not sure is the proper one, is to use:

    # backwards compatibility with apache 2.2
    Order allow,deny
    Allow from all
    
    # forward compatibility with apache 2.4
    Require all granted
    Satisfy Any
    

    This should resolve your problem, or at least did for me. Now the problem will probably be much harder to solve if you have more complex access rules...

    See also this fairly similar question. The Debian wiki also has useful instructions for supporting both 2.2 and 2.4.

提交回复
热议问题