squid八爪鱼安装部署

简介

本次安装版本为4.17版本,在此之前安装5.9版本启动时起不来,然后还不报错(目前来看原因应该是缺少squid用户的问题),所以退而求次,安装4.17版本

步骤

1、上传squid-4.17.tar.gz到服务器data目录下
2、解压并建立squid文件夹

[root@zonghe03 data]# mkdir squid
[root@zonghe03 data]# tar zxvf squid-4.15.tar.gz
[root@zonghe03 data]# ll
total 10544
drwx------  2 root root   16384 Jul  7 11:11 lost+found
drwxr-xr-x  8 root root    4096 Jul  7 15:52 squid
drwxr-xr-x 16 1000 1000    4096 Jul  7 15:40 squid-4.17
-rw-r--r--  1 root root 5292674 Jul  7 15:37 squid-4.17.tar.gz
drwxr-xr-x 16 1000 1000    4096 Jul  7 15:17 squid-5.9
-rw-r--r--  1 root root 5471615 Jul  6 18:05 squid-5.9.tar.gz

3、进入解压后的squid-4.17 进行配置 安装

[root@zonghe03 data]# cd squid-4.17
[root@zonghe03 squid-4.17]# ./configure --prefix=/data/squid --sysconfdir=/data/squid/config --enable-linux-netfilter
[root@zonghe03 data]# make
[root@zonghe03 data]# make install

4、进入data/sbin启动 这时候就出现问题了

[root@zonghe03 sbin]# ./squid 
WARNING: Cannot write log file: /data/squid/var/logs/cache.log
/data/squid/var/logs/cache.log: Permission denied
         messages will be sent to 'stderr'.

根据报错然后结合百度知道是缺少squid且没权限的问题,那我们就进行建用户和赋权限
5、查看是否有squid用户

[root@zonghe03 data]# cat /etc/passwd
发现没有
进行建用户
[root@zonghe03 squid]# useradd -M -s /sbin/nologin squid
[root@zonghe03 squid]# cat /etc/passwd
这时候就有squid用户了
[root@zonghe03 squid]# chown -R squid:squid /data/squid/
[root@zonghe03 squid]# ll
total 24
drwxr-xr-x 2 squid squid 4096 Jul  7 15:52 bin
drwxr-xr-x 2 squid squid 4096 Jul  7 15:52 config
drwxr-xr-x 2 squid squid 4096 Jul  7 15:52 libexec
drwxr-xr-x 2 squid squid 4096 Jul  7 15:52 sbin
drwxr-xr-x 5 squid squid 4096 Jul  7 15:52 share
drwxr-xr-x 5 squid squid 4096 Jul  7 15:52 var
[root@zonghe03 data]# chmod -R 777 squid/
查看版本
[root@zonghe03 squid]# ./sbin/squid -v
Squid Cache: Version 4.17
Service Name: squid
configure options:  '--prefix=/data/squid' '--sysconfdir=/data/squid/config' '--enable-linux-netfilter' --enable-ltdl-convenience

6、启动

[root@zonghe03 squid]# ./sbin/squid
[root@zonghe03 squid]# ps -ef |grep squid
root     18874     1  0 16:05 ?        00:00:00 ./sbin/squid
nobody   18876 18874  0 16:05 ?        00:00:00 (squid-1) --kid squid-1
nobody   18877 18876  0 16:05 ?        00:00:00 (logfile-daemon) /data/squid/var/logs/access.log
root     18920 19687  0 16:05 pts/1    00:00:00 grep --color=auto squid

7、配置客户端进行验证

在另一台机器的profice进行配置
[root@zonghe02 ~]# vim /etc/profile
http_proxy=http://172.xx.xxx.xx:3128
https_proxy=http://172.xx.xxx.xx:3128
no_proxy=172.xx.xxx.,xx.255.xx.xx
[root@zonghe02 ~]# source /etc/profile
[root@zonghe02 ~]# curl www.baidu.com
<!DOCTYPE html>
<!--STATUS OK--><html> <head><meta http-equiv=content-type content=text/html;charset=utf-8><meta http-equiv=X-UA-Compatible content=IE=Edge><meta content=always name=referrer><link rel=stylesheet type=text/css href=http://s1.bdstatic.com/r/www/cache/bdorz/baidu.min.css><title>缇搴︿镐革间綘灏辩ラ</title></head> <body link=#0000cc> <div id=wrapper> <div id=head> <div class=head_wrapper> <div class=s_form> <div class=s_form_wrapper> <div id=lg> <img hidefocus=true src=//www.baidu.com/img/bd_logo1.png width=270 height=129> </div> <form id=form name=f action=//www.baidu.com/s class=fm> <input type=hidden name=bdorz_come value=1> <input type=hidden name=ie value=utf-8> <input type=hidden name=f value=8> <input type=hidden name=rsv_bp value=1> <input type=hidden name=rsv_idx value=1> <input type=hidden name=tn value=baidu><span class="bg s_ipt_wr"><input id=kw name=wd class=s_ipt value maxlength=255 autocomplete=off autofocus></span><span class="bg s_btn_wr"><input type=submit id=su value=缇搴︿镐?class="bg s_btn"></span> </form> </div> </div> <div id=u1> <a href=http://news.baidu.com name=tj_trnews class=mnav>姘榛</a> <a href=http://www.hao123.com name=tj_trhao123 class=mnav>hao123</a> <a href=http://map.baidu.com name=tj_trmap class=mnav>灏?/a> <a href=http://v.baidu.com name=tj_trvideo class=mnav>瑙棰</a> <a href=http://tieba.baidu.com name=tj_trtieba class=mnav>璐村</a> <noscript> <a href=http://www.baidu.com/bdorz/login.gif?login&amp;tpl=mn&amp;u=http%3A%2F%2Fwww.baidu.com%2f%3fbdorz_come%3d1 name=tj_login class=lb>缁褰</a> </noscript> <script>document.write('<a href="http://www.baidu.com/bdorz/login.gif?login&tpl=mn&u='+ encodeURIComponent(window.location.href+ (window.location.search === "" ? "?" : "&")+ "bdorz_come=1")+ '" name="tj_login" class="lb">缁褰</a>');</script> <a href=//www.baidu.com/more/ name=tj_briicon class=bri style="display: block;">驽や骇?/a> </div> </div> </div> <div id=ftCon> <d
iv id=ftConw> <p id=lh> <a href=http://home.baidu.com>?                                                                                        蹇
璇?/a>&nbsp; <a href=http://jianyi.baidu.com/ class=cp-feedback>=c棣</a>&nbsp;浜琁CP030173&nbsp; <img src=//www.baidu.com/img/gs.gif> </p> </div> </div> </div> </body> </html>
[root@zonghe02 ~]# 1;2c     

8、同时在代理服务的日志能够看到相应记录

[root@zonghe03 logs]# pwd
/data/squid/var/logs
[root@zonghe03 logs]# cat access.log 
1688717347.290    160 172.xx.xxx.xx TCP_MISS/200 2842 GET http://www.baidu.com/ - HIER_DIRECT/xx.156.xx.xx text/html
1688717467.415    149 172.xx.xxx.xx TCP_MISS/200 2842 GET http://www.baidu.com/ - HIER_DIRECT/xx.156.xx.18 text/html

第1章 介绍 1.1 Web缓存 1.2 Squid的简明历史 1.3 硬件和操作系统要求 1.4 squid是开源的 1.5 Squid的Web主页 1.6 获取帮助 1.6.1 FAQ 1.6.2 邮件列表 1.6.3 职业支持 1.7 启动Squid 第2章 获取Squid 2.1 版本和发布 2.2 使用源代码 2.3 预编译的二进制文件 2.4 匿名CVS 2.5 devel.squid-cache.org 第3章 编译和安装 3.1 安装之前 3.2 解开源代码包 3.3 调整内核 3.3.1 文件描述符 3.3.2 Mbuf Clusters 3.3.3 临时端口范围 3.4 Configure脚本 3.4.1 configure选项 3.4.2 运行configure 3.5 编译 3.6 安装 3.7 打补丁 3.8 重运行configure 第4章 快速配置向导 4.1 squid.conf语法 4.2 User ID 4.3 端口号 4.4 日志文件路径 4.5 访问控制 4.6 可见主机名 4.7 管理联系信息 4.8 下一步 第5章 运行Squid 5.1 squid命令行选项 5.2 对配置文件查错 5.3 初始化cache目录 5.4 在终端窗口里测试squid 5.5squid作为服务进程运行 5.5.1 squid_start脚本 5.6 启动脚本 5.6.1 /etc/rc.local 5.6.2 init.d和rc.d 5.6.3 /etc/inittab 5.7 chroot环境 5.8 停止squid 5.9 重配置运行中的squid进程 5.10 滚动日志文件 第6章 访问控制 6.1 访问控制元素 6.1.1 一些基本的ACL类型 6.1.2 ACL类型 6.1.3 外部ACL 6.1.4 处理长ACL列表 6.1.5 Squid如何匹配访问控制元素 6.2 访问控制规则 6.2.1 访问规则语法 6.2.2 Squid如何匹配访问规则 6.2.3 访问列表风格 6.2.4 延时检查 6.2.5 减缓和加速规则检查 6.3 常见用法 6.3.1 仅仅允许本地客户 6.3.2 阻止恶意客户 6.3.3 内容过滤 6.3.4 在工作时间的受限使用 6.3.5 阻止squid与非HTTP服务器会话 6.3.6 授予某些用户特殊的访问 6.3.7 阻止邻近cache的滥用 6.3.8 使用IP地址拒绝请求 6.3.9 http_reply_access示例 6.3.10 阻止对本地站点的cache命中 6.4 测试访问控制 第7章 磁盘缓存基础 7.1 cache_dir指令 7.1.1 参数:Scheme 7.1.2 参数:Directory 7.1.3 参数:Size 7.1.4 参数:L1和L2 7.1.5 参数:Options 7.2 磁盘空间基准 7.3 对象大小限制 7.4 分配对象到缓存目录 7.5 置换策略 7.6 删除缓存对象 7.6.1 删除个别对象 7.6.2 删除一组对象 7.6.3 删除所有对象 7.7 refresh_pattern 第8章 高级磁盘缓存主题 8.1 是否存在磁盘I/O瓶颈? 8.2 文件系统调整选项 8.3 可选择的文件系统 8.4 aufs存储机制 8.4.1 aufs如何工作 8.4.2 aufs发行 8.4.3 监视aufs操作 8.5 diskd存储机制 8.5.1 diskd如何工作 8.5.2 编译和配置diskd 8.5.3 监视diskd 8.6 coss存储机制 8.6.1 coss如何工作 8.6.2 编译和配置coss 8.6.3 coss发行 8.7 null存储机制 8.8 哪种最适合我? 第9章 Cache拦截 9.1 它如何工作? 9.2 为何要(或不要)拦截? 9.3 网络设备 9.3.1 内置Squid 9.3.2 四层交换 9.3.3 Cisco策略路由 9.3.4 Web Cache Coordination协议 9.4 操作系统配置 9.4.1 Linux 9.4.2 FreeBSD 9.4.3 OpenBSD 9.4.4 在NetBSD和其他系统上的IPFilter 9.5 配置Squid 9.5.1 配置WCCPv1 9.6 调试
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值