设置一个Apache代理与认证 [英] Setting up an Apache Proxy with Authentication
问题描述
我需要设置了身份验证的代理来验证连接到互联网的应用程序的行为。
I need to set up a proxy with authentication to verify the behavior of an application that connects to the internet.
我想建立一个Apache安装与转发代理和身份验证,即使我靠近,使其工作,我不知道是否有可能是更好的办法,因为配置是相当深奥的。
I am trying to set-up an Apache installation with forward proxy and authentication, and even though I am close to make it work, I wonder if there is maybe a better way, as the configuration is fairly esoteric.
Apache如何可以配置成这种方式工作?
How can Apache be configured to work this way?
有一个已经配置任何其他好的选择?也许一些虚拟机或其他一些软件工具,而不是Apache的?
Is there any other good option that is already configured? Maybe some VM or some other software tool, instead of Apache?
推荐答案
有关记录,我这是怎么设置Apache用作正向代理基本验证:
For the record, this is how I set up apache to be used as a forward-proxy with basic authentication:
开放的http.conf
Open http.conf
取消以下的LoadModule指令,以使代理的funcionality
Uncomment the following LoadModule directives to enable proxy funcionality
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
以下指令添加到http.conf中启用身份验证
Add the following directives to the http.conf to enable authentication
ProxyRequests On
ProxyVia On
<Proxy *>
Order deny,allow
Allow from all
AuthType Basic
AuthName "Password Required"
AuthUserFile password.file
AuthGroupFile group.file
Require group usergroup
</Proxy>
创建一个使用htpasswd.exe实用程序password.file。将它放在了Apache的根目录
Create a password.file using the htpasswd.exe utility. Place it on the Apache Root directory
htpasswd.exe -c password.file username
使用文本编辑器在同一水平为具有以下内容的password.file创建group.file
Create a group.file using a text editor at the same level as the password.file with the following contents
usergroup: username
然后运行 apachectl中重启
拿起配置更改。
这篇关于设置一个Apache代理与认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!