squid+icap测试配置

相关配置为公司内环境配置,综合网关用squid模拟。

项目基本架构为:网关作为ICAP Client,ICAP Server用的是C-ICAP SERVER 0.2.5,往后为公司的业务系统,ICAP Server作用是在网关与业务系统之间作适配。

1、squid

       squid支持ICAP Client,本次配置如下:

--------------------------------------------------------------------squid.conf--------------------------------------------------------------------

#Icap client for squid
icap_enable on
icap_preview_enable on
icap_preview_size 1024
icap_206_enable off
icap_send_client_ip on
#将HTTP回复发送给icap服务器
icap_service service_res respmod_precache 1 icap://192.168.0.246:1344/ToolbarInsertion
#将HTTP请求发送给icap服务器
icap_service service_req reqmod_precache 0 icap://192.168.0.246:2344/ex206
adaptation_access service_res allow all
adaptation_access service_req allow all

--------------------------------------------------------------------end--------------------------------------------------------------------
ToolbarInsertion:RESPMOD请求URI;

ex206:REQMOD请求URI;

2、icap

      icap支持OPTIONS、REQMOD、RESPMOD(参考RFC3507);

      ToolbarInsertion配置文件:srv_xxxxxxx.conf

--------------------------------------------------------------------srv_xxxxxxx.conf--------------------------------------------------------------------

#
# To enable srv_xxxxxxx service in c-icap, copy this file in c-icap
# configuration directory and add the following line at the end of
# c-icap.conf file:
#       Include srv_xxxxxxx.conf
#

# Module: srv_xxxxxxx
#

# Load the srv_xxxxxxx service:
Service wkcash_module srv_xxxxxxx.so

# Add the alias wkwsc for srv_xxxxxxx service. It is used by many
ServiceAlias ToolbarInsertion srv_xxxxxxx


# wk cash module settings

# TAG: srv_xxxxxxx.EmbedHtmlContentTypes
# Format: srv_xxxxxxx.EmbedHtmlContentTypes type1 [type2] ...
# Description:
#    the list of Content types or groups of Content types which will be
#    Embed. For supported types look in c-icap.magic
#    configuration file.
# Default:
#    text/html application/vnd.wap.xhtml+xml application/xhtml+xml.
srv_xxxxxxx.EmbedHtmlContentTypes text/html application/vnd.wap.xhtml+xml application/xhtml+xml

# TAG: srv_xxxxxxx.EmbedWmlContentTypes
# Format: srv_xxxxxxx.EmbedWmlContentTypes type1 [type2] ...
# Description:
#    the list of Content types or groups of Content types which will be
#    Embed. For supported types look in c-icap.magic
#    configuration file.
# Default:
#    text/vnd.wap.wml
srv_xxxxxxx.EmbedWmlContentTypes text/vnd.wap.wml

# TAG: srv_xxxxxxx.CashMereServer
# Format: srv_xxxxxxx.CashMereServer Host Port
# Description:
#   The CashMere Server Host Information
# Default:
#    localhost 18080
srv_xxxxxxx.CashMereServer 192.168.0.246 8090
#srv_xxxxxxx.CashMereServer 192.168.0.246 80
#srv_xxxxxxx.CashMereServer 192.168.0.45 80

# TAG: srv_xxxxxxx.LocalMemCacheServer
# Format: srv_xxxxxxx.LocalMemCacheServer onoff
# Description:
#   Set To Enable or Disable The Local Memcache Server
# Default:
#    off
srv_xxxxxxx.LocalMemCacheServer off

# TAG: srv_xxxxxxx.MemCacheServer
# Format: srv_xxxxxxx.MemCacheServer Host Port
# Description:
#   The Memcache Server Host Information
# Default:
#    localhost 11211
srv_xxxxxxx.MemCacheServer localhost 11212
#srv_xxxxxxx.MemCacheServer 192.168.0.45 11212

# TAG: srv_xxxxxxx.MemCacheExpireTime
# Format: srv_xxxxxxx.MemCacheExpireTime seconds
# Description:
#   Set To Memcache Server ExpireTime
# Default:
#    off
srv_xxxxxxx.MemCacheExpireTime 60

# TAG: srv_xxxxxxx.AccessLogPath
# Format: srv_xxxxxxx.AccessLogPath path
# Description:
#   The Access Log Path Information
# Default:
#    c-icap default log path
srv_xxxxxxx.AccessLogPath /home/src/c_icap-0.2.5_req_mod/var/log

srv_xxxxxxx.ServerGroup 1

# End module: srv_xxxxxxx
--------------------------------------------------------------------end--------------------------------------------------------------------
       C-ICAP Server安装后配置文件在:etc/c-icap.conf

--------------------------------------------------------------------c-icap.conf--------------------------------------------------------------------

#
# This file contains the default settings for c-icap
#
#


# TAG: PidFile
# Format: PidFile pid_file
# Description:
#    The file to store the pid of the main process of the c-icap server.
# Default:
#    PidFile /var/run/c-icap/c-icap.pid
PidFile /var/run/c-icap/c-icap-req.pid

# TAG: CommandsSocket
# Format: CommandsSocket socket_file
# Description:
#    The path of file to use as control socket for c-icap
# Default:
#    CommandsSocket /var/run/c-icap/c-icap.ctl
CommandsSocket /var/run/c-icap/c-icap-req.ctl

# TAG: Timeout
# Format: Timeout seconds
# Description:
#    The time in seconds after which a connection without activity
#    can be cancelled.
# Default:
#    Timeout 300
Timeout 300

# TAG: MaxKeepAliveRequests
# Format: MaxKeepAliveRequests number
# Description:
#    The maximum number of reque

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值