资源描述:
《squid 2.6安装文档无错版》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、1、下载squid2.6版的软件官方网址:http://www.squid-cache.org/到那里去下载最新版的squid软件将此软件包上传至web主机。并在主机上将下载下来的软件包解压。如果你下载的gz包的话。就用tarzxvfXXXXX.gz(XXXX.gz为你下载来的软件包名)如果你下载的是gz2包。那么就用tarjxvfXXXX.gz2(XXXX.gz2为你下载来的软件包名)2、进入你解压出来的那个目录。然后执行编译安装./configure--exec_prefix=/usr/local/squid--bindir=/usr/sbin--
2、libexecdir=/usr/lib/squid--sysconfdir=/etc/squid--enable-poll--enable-snmp--enable-removal-policies="heap,lru"--enable-storeio="aufs,coss,diskd,null,ufs"--enable-ssl--with-openssl=/usr/kerberos--enable-delay-pools--enable-linux-netfilter--with-pthreads--enable-auth="basic"--with
3、-winbind-auth-challenge--enable-useragent-log--enable-referer-log--disable-dependency-tracking--enable-cachemgr-hostname=localhost--disable-ident-lookups--enable-truncate--enable-underscores--datadir=/usr/share/squid--enable-basic-auth-helpers="NCSA"--enable-err-language="Simpli
4、fy_Chinese"--enable-default-err-language="Simplify_Chinese"编译完后再执行makemakeinstall好了。安装完毕后,修改目录权限,默认是以"nobody"用户运行squid.所以我们要为/usr/local/squid/var设置相应的权限,否则会报以下错误FATAL:Failedtomakeswapdirectory/usr/local/squid/var/cache:(13)PermissiondeniedSquidCache(Version2.5.STABLE13):Terminat
5、edabnormally.CPUUsage:0.000seconds=0.000user+0.000sysMaximumResidentSize:0KBPagefaultswithphysicali/o:4或者以下错误FATAL:Cannotopen'/usr/local/squid/var/logs/access.log'forwriting.Theparentdirectorymustbewriteablebytheuser'nobody',whichisthecache_effective_usersetinsquid.conf.最简单的处理办法
6、就是chown-Rnobody:nobody/usr/local/squid/varok,生成缓存目录/usr/local/squid/sbin/squid-z然后启动squid,测试一下是否成功/usr/local/squid/bin/Runcache默认端口是3128,用ie测试一下,如果能看到中文的拒绝访问错误提示,就说明安装正确,并且已经使用.以后就可以直接/usr/local/squid/bin/Runcache&后台运行即可,现在我们开始讲如何配置squid.conf文件visible_hostnamelocalhost#你的主机名可以是l
7、ocalhosthttp_port211.XX.XX.XXX:80vhostvport#你需要做squid服务器的IP及端口号icp_port0cache_mem900MB#squid所使用的内存一般为物理内存的1/3cache_swap_low90#缓存最低使用cache_swap_high95#缓存最高使用maximum_object_size20000KB#当大于200000K时不对文件进maximum_object_size_in_memory4096KB#放入内存的最小大小cache_dirufs/dev/shm/tmp100016256#这
8、里我们会在后面再讲cache_store_lognonecache_varyon#apache