Hi Guys
i am running into some problem with .htpasswd on virtual host apache 2.2.3
here is vitrual hosts
ServerName www.site.com
ProxyPass / http://localhost:70/
ProxyPassReverse / http://localhost:70/
I can't find syntax for implementing
AuthUserFile
AuthGroupFile /dev/null
AuthName
AuthType Basic
hope somebody knows how it can be done
thank you
[SOLVED] .htpasswd on virtual host
Re: .htpasswd on virtual host
The context for AuthUserFile and related directives is and .htaccess. My only suggestion to attempt basic auth is:
[code]<VirtualHost *:80>
ServerName www.site.com
ProxyPass / http://localhost:70/
ProxyPassReverse / http://localhost:70/
<Directory />
AuthUserFile ...
AuthName ...
AuthType Basic
require valid-user # or require user ...
</Directory>
</VirtualHost>[/code]
http://httpd.apache.org/docs/current/mod/mod_proxy.html says you can use:
[code]<Proxy *>
Order Deny,Allow
Deny from all
Allow from 192.168.0
</Proxy>[/code]
to limit by IP. That's probably your best shot if basic auth doesn't work.
[code]<VirtualHost *:80>
ServerName www.site.com
ProxyPass / http://localhost:70/
ProxyPassReverse / http://localhost:70/
<Directory />
AuthUserFile ...
AuthName ...
AuthType Basic
require valid-user # or require user ...
</Directory>
</VirtualHost>[/code]
http://httpd.apache.org/docs/current/mod/mod_proxy.html says you can use:
[code]<Proxy *>
Order Deny,Allow
Deny from all
Allow from 192.168.0
</Proxy>[/code]
to limit by IP. That's probably your best shot if basic auth doesn't work.
Re: .htpasswd on virtual host
Hi Logan
Thank for your reply
however when i use your suggested config, pop up for user/password doesn't come up
yesterday i was able to make that pop window come up but server could't authenticate user/password provided in the .htpasswd file and the password was changed to be super simple
This is the config on which i have pop up for user/password however is a i said can't get in anyway
ServerName www.site.com
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/location to the /.htpasswd"
Require valid-user
AllowOverride All
Order allow,deny
Allow from all
ProxyPass / http://localhost:7001/
ProxyPassReverse / http://localhost:7001/
here is the error_log
[Fri Aug 27 09:39:19 2010] [error] [client xx.xx.xx.130] request failed: error reading the headers
mozilla get this message
Bad Request
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.
Cache-Control: max-age=0, max-age=0, max-age=0, max-age=0, max-age=0, max-a
Thank for your reply
however when i use your suggested config, pop up for user/password doesn't come up
yesterday i was able to make that pop window come up but server could't authenticate user/password provided in the .htpasswd file and the password was changed to be super simple
This is the config on which i have pop up for user/password however is a i said can't get in anyway
ServerName www.site.com
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/location to the /.htpasswd"
Require valid-user
AllowOverride All
Order allow,deny
Allow from all
ProxyPass / http://localhost:7001/
ProxyPassReverse / http://localhost:7001/
here is the error_log
[Fri Aug 27 09:39:19 2010] [error] [client xx.xx.xx.130] request failed: error reading the headers
mozilla get this message
Bad Request
Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.
Cache-Control: max-age=0, max-age=0, max-age=0, max-age=0, max-age=0, max-a
Re: .htpasswd on virtual host
i think problem in browser.
try 2 clean cache,cookies...try another browser...or try to reinstall mod_auth...
try 2 clean cache,cookies...try another browser...or try to reinstall mod_auth...
Re: .htpasswd on virtual host
It looks like you combined the and directives and I don't know if you can do that. I've never done any proxy stuff with Apache... The proxy documentation only has examples with IP-based restrictions, but it also links to [url=http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html]mod_authz_host[/url] which talks about using password authentication. If a isn't working, maybe you can try a instead.
Re: .htpasswd on virtual host
thanks
managed to fix it
thank you for your help
managed to fix it
thank you for your help
- AlanBartlett
- Forum Moderator
- Posts: 9326
- Joined: 2007/10/22 11:30:09
- Location: ~/Earth/UK/England/Suffolk
- Contact:
Re: [SOLVED] .htpasswd on virtual host
Thank you for reporting back.
For posterity, this thread is marked [SOLVED].
For posterity, this thread is marked [SOLVED].