Setting up an Apache Proxy with Authentication

馋奶兔 提交于 2019-11-28 03:15:49
Mario Ortegón

For the record, this is how I set up apache to be used as a forward-proxy with basic authentication:

Open http.conf

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

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>

Create a password.file using the htpasswd.exe utility. Place it on the Apache Root directory

htpasswd.exe -c password.file username

Create a group.file using a text editor at the same level as the password.file with the following contents

usergroup: username

Then run apachectl restart to pick up the configuration changes.

I use Squid.

It's quite easy to install it and to setup it with a basic authentication with the "auth_param" directive in the configuration file.

You will find some samples, understand how it works, and all details about the auth_param on Squid Website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!