FreeBSD/Proxy

mod_proxy

  1. 概要
  2. 設定
  3. IE6.0での設定

概要

Apache1.3でmod_proxyを使いproxyサーバを建ててみる。

設定

 <IfModule mod_proxy.c>
    ProxyRequests On

    <Directory proxy:*>
        Order deny,allow
        Deny from all
        Allow from 192.168.0.0/255.255.255.0
    </Directory>

    #
    # Enable/disable the handling of HTTP/1.1 "Via:" headers.
    # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
    # Set to one of: Off | On | Full | Block
    #
#
<IfModule mod_proxy.c>
    ProxyRequests On
# プロキシを使うことができる範囲を指定する
    <Directory proxy:*>
        Order deny,allow
        Deny from all
        Allow from 192.168.0.0/255.255.255.0
    </Directory>
# RFC2068に指定されるVIAの設定。viaを消したいのでデフォルトを使う
    #
    # Enable/disable the handling of HTTP/1.1 "Via:" headers.
    # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
    # Set to one of: Off | On | Full | Block
    #
#     ProxyVia On
    #
    # To enable the cache as well, edit and uncomment the following lines:
    # (no cacheing without CacheRoot)
    #
    CacheRoot "/usr/local/www/proxy"
# キャッシュのサイズを書く
    CacheSize 5000
# キャッシュのチェックの間隔
    CacheGcInterval 4
#  有効期限
    CacheMaxExpire 24
    CacheLastModifiedFactor 0.1
    CacheDefaultExpire 1
# キャッシュをさせたくないドメインやIPアドレスを書く
# ここではサンプル的に書いてみただけ。
    NoCache yahoo.co.jp

</IfModule>

IE6.0での設定

▼インターネットオプションから[LANの設定]をクリック

mod_proxy1.jpg


▼サーバのアドレスを入力する。ポートはApacheの設定にあわせる。

mod_proxy2.jpg