Bug 843286 - mod_authn_file.so is not enabled on the cartridge's apache conf. That causes: "Invalid command AuthUserFile; perhaps it is misspelled"
mod_authn_file.so is not enabled on the cartridge's apache conf. That causes...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Rob Millner
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-25 19:25 EDT by Nam Duong
Modified: 2015-05-14 18:57 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-06 13:48:01 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Nam Duong 2012-07-25 19:25:25 EDT
Description of problem:
As per forum post: 
https://openshift.redhat.com/community/forums/openshift/how-to-password-protect-my-app

user is trying to password-protect the working dir via .htaccess and .htpasswd, but is getting an error:  
"Invalid command AuthUserFile; perhaps it is misspelled"

Is this use case supported?
Comment 1 Christian Jann 2012-08-28 05:57:55 EDT
Same here:

-----.htaccess-------
AuthUserFile /var/lib/stickshift/12345678901234567890/app-root/runtime/repo/php/internal-project-docu/.htpasswd
AuthType Basic
AuthName "Project"
Require valid-user
-----.htaccess-------

-----.htpasswd-------
user:hash
-----.htpasswd-------

firefox http://projects.domain.tld/internal-project-docu

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Apache/2.2.15 (Red Hat) Server at projects.domain.tld Port 80

[www-userxy.rhcloud.com ~]\> cat php-5.3/logs/error_log-20120828-000000-EST 
...
[Tue Aug 28 05:28:15 2012] [notice] Apache/2.2.15 (Unix) configured -- resuming normal operations
[Tue Aug 28 05:28:39 2012] [alert] [client 127.4.123.321] /var/lib/stickshift/12345678901234567890/app-root/runtime/repo/php/internal-project-docu/.htaccess: Invalid command 'AuthUserFile', perhaps misspelled or defined by a module not included in the server configuration

I really need this feature.
Comment 2 Lee Graham 2012-10-12 08:24:02 EDT
+1 - Same issue as Christian.




HTACCESS FILE
AuthUserFile /var/lib/stickshift/*************************************************/app-root/runtime/repo/php/.htpasswd AuthType Basic AuthName "Admin" Require valid-user

HTPASSWD FILE (username:password) 
username:$apr1$vl0h5yU7$Ea0j8gD6QoDSWcXzxW1LC.





Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.





ERROR LOG
[Thu Oct 11 15:32:54 2012] [alert] [client 127.2.94.129] /var/lib/stickshift/*************************************************/app-root/runtime/repo/php/.htaccess: Invalid command 'AuthUserFile', perhaps misspelled or defined by a module not included in the server configuration, referer: http://******-***.rhcloud.com/
Comment 4 Rob Millner 2012-10-18 15:31:04 EDT
Pull requests merged.
Comment 5 Jianwei Hou 2012-10-18 22:11:45 EDT
Verified on devenv_2348

Steps:
1. Create an app
2. SSH into app, use htpasswd to create password
[php1-2348t.dev.rhcloud.com php]\> pwd
/var/lib/openshift/194a5f87ea724988ba352377f0975e81/app-root/runtime/repo/php
[php1-2348t.dev.rhcloud.com php]\> htpasswd -c .htpasswd jhou
New password: 
Re-type new password: 
Adding password for user jhou
[php1-2348t.dev.rhcloud.com php]\> cat .htpasswd 
jhou:FZK7j.E0AR2Rs

password created successfully.
Comment 6 edd 2012-10-25 00:48:09 EDT
Creating a password using htpasswd works, but the server still throws a 500 error. The logs say:

[Thu Oct 25 00:39:46 2012] [alert] [client 127.2.105.129] /var/lib/stickshift/---/app-root/runtime/repo/php/.htaccess: Invalid command 'AuthUserFile', perhaps misspelled or defined by a module not included in the server configuration
Comment 7 Rob Millner 2012-10-25 14:05:29 EDT
This is fixed in our development environment but hasn't moved into production yet (hence the bug state in verified rather than closed).

It should go to production in a few weeks.

Note You need to log in before you can comment on or make changes to this bug.