How to setup forward proxy with authentication in Apache

There are many proxy software, squid is the popular one, but I don’t want to install it as I can reuse the Apache’s proxy function. Below I will introduce how to setup the forward proxy with authentication function in Apache 2.2.x.(The example based on Apache 2.2.x shipped with Oracle Linux 6)

  • Edit /etc/httpd/conf/httpd.conf, make sure mod_proxy module has been set to be loaded
LoadModule proxy_module modules/mod_proxy.so
  • Make sure the /etc/httpd/modules/mod_proxy.so exists
  • Find the mod_proxy keyword, and add following
<IfModule mod_proxy.c>
    ProxyRequests On
    ProxyRemote * http://<upper proxy IP>:<port>
	
   <Proxy *>
      Order deny,allow
      Deny from all
      Allow from all
      AuthType Digest
      AuthName <Realm Name>          <--- Realm Name
      AuthDigestDomain /             <--- Digest prtected domain
      AuthUserFile <digest password file>   <--- Password file generated by htdigest command
    require user <username>
   </Proxy>
  • Generate a digest password file contains the user/password info
#htdigest -c <filename> <Realm Name/AuthName> <Username>
>> <--- input password the first time
>> <--- input password the second time
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇