squid+tomcat+jdk+urlrewritefilter
来源:互联网 发布:mac 怎么设置端口 编辑:程序博客网 时间:2024/05/21 14:41
CODE:
squid-2.6.STABLE23.tar.gz
下载地址:
apache-tomcat-6.0.20-src.tar.gz
jdk-6u17-linux-x64.bin
urlrewritefilter-2.6.zip
CODE:
http://www.squid-cache.org/Versions/v2/2.6/squid-2.6.STABLE23.tar.gz
二、安装:
http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.20/src/apache-tomcat-6.0.20-src.tar.gz
http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u18-linux-x64.bin?BundledLineItemUUID=gvpIBe.o0B4AAAEn90tk0Tt9&OrderID=s9FIBe.oLBYAAAEn60tk0Tt9&ProductID=p_9IBe.pFJcAAAElWitRSbJV&FileName=/jdk-6u18-linux-x64.bin
http://tuckey.org/urlrewrite/dist/urlrewritefilter-2.6.zip
1、Squid:
#tar zvxf squid-2.6.STABLE23.tar.gz
#cd squid-2.6.STABLE23
#vi install.sh
CODE:
./configure \
#sh install.sh
make
make install
2、Tomcat:
#tar zvxf apache-tomcat-6.0.20-src.tar.gz
#mv apache-tomcat-6.0.20 tomcat-6.0.20
3、JDK:
#chmod u+x jdk-6u17-linux-x64.bin
#./ jdk-6u17-linux-x64.bin
安装过程需要输入yes
4、Urlrewrite:
#unzip urlrewritefilter-2.6.zip
#cp urlrewritefilter-2.6/WEB-INF/lib/urlrewrite-2.6.0.jar /usr/local/tomcat-6.0.20/webapps/ROOT/WEB-INF/lib/
#cp urlrewritefilter-2.6/WEB-INF/urlrewrite.xml /usr/local/tomcat-6.0.20/webapps/ROOT/WEB-INF
三、配置:
1、Squid:
#cd /usr/local/squid2/etc/
#vi squid.conf
CODE:
http_port 80 vhost vport
cache_peer 127.0.0.1 parent 8080 0 no-query originserver no-digest name=tomcat
cache_peer_domain tomcat tomcat.linuxtone.org
visible_hostname cache.linuxtone.org
cache_mgr hamgua@linuxtone.org
cache_effective_user squid
cache_effective_group squid
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl Safe_ports port 80
acl Safe_ports port 8080
acl SSL_ports port 443
acl CONNECT method CONNECT
http_access allow all
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
icp_access allow all
cache_replacement_policy lru
#cache_dir
cache_dir aufs /usr/local/squid2/cache 32768 64 64
cache_mem 2048 MB
max_open_disk_fds 0
#maximum_object_size 512 KB
#maximum_object_size_in_memory 256 KB
maximum_object_size 20 MB
maximum_object_size_in_memory 8 MB
refresh_pattern ^ftp:
refresh_pattern ^gopher:
refresh_pattern .
refresh_pattern -i /$
refresh_pattern -i .html$
refresh_pattern -i .shtml$
refresh_pattern -i .htm$
#refresh_pattern -i .jsp$
#refresh_pattern -i .[do|do\?.+]
refresh_pattern -i .css$
refresh_pattern -i .[js|js\?.+]