Squid 安装配置
2008-07-10 18:15
417 查看
安装系统 Linux ENT AS 4 2.6.9-5.ELsmp
安装软件是系统自带的 squid-2.5.STABLE6-3.i386
我的系统带2块网卡。一个外网地址。一个内网地址。防火墙配置可以让网内机器上网。
安装完成后,进入配置:
我只进行了简单配置,并且测试成功。
配置文件的位置在 /etc/squid/
[root@localhost squid]# vi squid.conf
以下是我的配置,具体说明配置文档里都有。以下是我所开启的配置,其中有些项是已经开启的:
http_port 192.168.1.205:3128 内网网关地址
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 40 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
cache_dir ufs /var/spool/squid 100 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
mime_table /etc/squid/mime.conf
pid_filename /var/run/squid.pid
debug_options ALL,1
client_netmask 255.255.255.255
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl advance src 192.168.1.1-192.168.1.10/32
acl normal src 192.168.1.11-192.168.1.200/32
acl baduser src 192.168.1.226/32
acl all src 0.0.0.0/0
http_access deny baduser
http_access allow advance
http_access allow normal
http_access allow all
http_reply_access allow all
icp_access allow all
cache_mgr 你的邮件地址
cache_effective_user squid
cache_effective_group squid
visible_hostname No1.proxy
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
dns_testnames netscape.com internic.net nlanr.net microsoft.com
error_directory /etc/squid/errors
coredump_dir /var/spool/squid
具体我就做了这些。
然后设置iptables 防火墙,加入;
iptables -t nat -A PREROUTING -s 192.168.1.225/32 -p tcp --dport 80 -j REDIRECT –to-ports 3128
然后启动squid
[root@localhost ~]# /usr/sbin/squid -f /etc/squid/squid.conf -a 3128
接下来可以查看日志:
如果有错误,可以查看squid.out文件。
然后你可以通过ip为 192.168.1.225 上网。如果可以上网。你就可以在/var/log/squid/access.log文件里看到你所访问的内容。证明squid成功。
安装软件是系统自带的 squid-2.5.STABLE6-3.i386
我的系统带2块网卡。一个外网地址。一个内网地址。防火墙配置可以让网内机器上网。
安装完成后,进入配置:
我只进行了简单配置,并且测试成功。
配置文件的位置在 /etc/squid/
[root@localhost squid]# vi squid.conf
以下是我的配置,具体说明配置文档里都有。以下是我所开启的配置,其中有些项是已经开启的:
http_port 192.168.1.205:3128 内网网关地址
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_mem 40 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
cache_dir ufs /var/spool/squid 100 16 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
mime_table /etc/squid/mime.conf
pid_filename /var/run/squid.pid
debug_options ALL,1
client_netmask 255.255.255.255
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl advance src 192.168.1.1-192.168.1.10/32
acl normal src 192.168.1.11-192.168.1.200/32
acl baduser src 192.168.1.226/32
acl all src 0.0.0.0/0
http_access deny baduser
http_access allow advance
http_access allow normal
http_access allow all
http_reply_access allow all
icp_access allow all
cache_mgr 你的邮件地址
cache_effective_user squid
cache_effective_group squid
visible_hostname No1.proxy
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
dns_testnames netscape.com internic.net nlanr.net microsoft.com
error_directory /etc/squid/errors
coredump_dir /var/spool/squid
具体我就做了这些。
然后设置iptables 防火墙,加入;
iptables -t nat -A PREROUTING -s 192.168.1.225/32 -p tcp --dport 80 -j REDIRECT –to-ports 3128
然后启动squid
[root@localhost ~]# /usr/sbin/squid -f /etc/squid/squid.conf -a 3128
接下来可以查看日志:
如果有错误,可以查看squid.out文件。
然后你可以通过ip为 192.168.1.225 上网。如果可以上网。你就可以在/var/log/squid/access.log文件里看到你所访问的内容。证明squid成功。
相关文章推荐
- 【转合辑】squid的安装配置
- CentOS6.2安装配置Squid
- 在Cent OS 5.5上安装配置Squid反向代理服务器
- squid的sarg安装跟配置,版本2.3.5
- 安装squid3.0,配置squid3.0笔记
- CentOS 6.7 下 Squid 代理服务器 的 安装与配置
- CentOS 6.6编译安装Squid 配置反向代理服务器
- rhel6下安装配置Squid过程
- linux下安装Squid代理的详细配置教程
- Redhat Squid Web缓存安装配置
- centos6下安装与配置squid代理
- squid3缓存服务器编译安装和高命中率配置示例
- CentOS 6.6编译安装Squid 配置反向代理服务器
- ubuntu安装配置squid进行代理
- Squid For Windows 安装配置(转)
- squid安装配置(反向代理)
- windows下squid安装与配置 缓存服务器
- ubuntu11.10上安装Squid配置代理服务器
- Squid的Linux下安装配置笔记(下)
- Squid安装及详细配置