Invalid command 'CGIPassAuth' when attempting to use REST api

General discussion about MantisBT Plugins

Moderators: Developer, Contributor

Post Reply
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Invalid command 'CGIPassAuth' when attempting to use REST api

Post by acoder2020 »

I get this internal server error when attempting to invoke the REST api:
[Wed Feb 21 15:41:56.495732 2024] [core:alert] /data/www/site/public_html/mantisbt-2.26.0/api/rest/.htaccess: Invalid command 'CGIPassAuth', perhaps misspelled or defined by a module not included in the server configuration
Here's my httpd version:

Code: Select all

[user@box]# httpd -v
Server version: Apache/2.4.6 (Red Hat Enterprise Linux)
[user@box]#

If I try to manually upgrade to 2.4.13 or higher, I will be giving up the support I get RHEL.

Is there a workaround for CGIPassAuth?
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Invalid command 'CGIPassAuth' when attempting to use REST api

Post by atrol »

Please use Search before posting and read the Manual
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: Invalid command 'CGIPassAuth' when attempting to use REST api

Post by acoder2020 »

Took a second to find this answer but this fix works

vi /path/to/mantisbt-2.26.0/api/rest/.htaccess

## add the SetEnvIf line below to the top of the .htaccess file:
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

### comment out the lines below
##### Requests failing due to missing Authorization header, see #26365
#### CGIPassAuth On




Source: https://devblog.cyotek.com/post/restori ... -using-php
Post Reply