(转载)Squid反向代理托管的虚拟主机
时间:2009-08-24 来源:liang3391
编译参数
./configure ‘–prefix=/opt/squid’ ‘–enable-dlmalloc’ ‘–enable-gnuregex’ ‘–enable-async-io’ ‘–enable-removal-policies=heap,lru’ ‘–enable-delay-pools’ ‘–enable-snmp’ ‘–enable-storeio=ufs,aufs,null’ ‘–enable-kill-parent-hack’ ‘–disable-select’ ‘–enable-auth=basic’ ‘–with-aio’ ‘–disable-ident-lookup’ ‘–with-filedescriptors=102400′ ‘–enable-epoll’ ‘–enable-linux-netfilter’ ‘–enable-underscore’ ‘–enable-arp-acl’ ‘–enable-cache-digests’ ‘–enable-icmp’ ‘–enable-large-cache-file’ ‘–with-large-files’ ‘–localstatedir=/opt/squid/var’ ‘–enable-stacktraces’ ‘–disable-wccpv2′ ‘–disable-wccp’ ‘–enable-referer-log’ ‘–enable-useragent-log’ ‘–disable-htcp’
make
make install
./configure ‘–prefix=/opt/squid’ ‘–enable-dlmalloc’ ‘–enable-gnuregex’ ‘–enable-async-io’ ‘–enable-removal-policies=heap,lru’ ‘–enable-delay-pools’ ‘–enable-snmp’ ‘–enable-storeio=ufs,aufs,null’ ‘–enable-kill-parent-hack’ ‘–disable-select’ ‘–enable-auth=basic’ ‘–with-aio’ ‘–disable-ident-lookup’ ‘–with-filedescriptors=102400′ ‘–enable-epoll’ ‘–enable-linux-netfilter’ ‘–enable-underscore’ ‘–enable-arp-acl’ ‘–enable-cache-digests’ ‘–enable-icmp’ ‘–enable-large-cache-file’ ‘–with-large-files’ ‘–localstatedir=/opt/squid/var’ ‘–enable-stacktraces’ ‘–disable-wccpv2′ ‘–disable-wccp’ ‘–enable-referer-log’ ‘–enable-useragent-log’ ‘–disable-htcp’
make
make install
squid.conf文件如下
cache_effective_user squid
cache_effective_group squid
visible_hostname vcache
http_port xxx.xxx.xxx.xxx:80 vhost vport
cache_peer 61.152.239.159 parent 80 0 no-query originserver
cache_peer_domain 61.152.239.159 www.opvps.com
acl all src
http_access allow all
cache_log /opt/squid/logs/cache.log
acl QueryString url_regex \.php?
no_cache deny QueryString
maximum_object_size 10240 KB
maximum_object_size_in_memory 512 KB
access_log /opt/squid/logs/access.log squid
例 我的站点www.opvps.com的真实IP是61.152.239.159
测试,首先将本机的hosts中加入
XXX.XXX.XXX.XXX www.opvps.com
##其中xxx.xxx.xxx.xxx为squid的IP地址
相关阅读 更多 +
排行榜 更多 +