Page 1 of 1

Invalid command 'CGIPassAuth' when attempting to use REST api

Posted: 21 Feb 2024, 20:55
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?

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

Posted: 21 Feb 2024, 21:09
by atrol

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

Posted: 21 Feb 2024, 21:14
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