ubuntu8.04 server +squid3做代理服务器(实用)

简介:
目标:代理公司所有用户上INTERNET,分三类用户,一类高级用户,不分时段,不受限访问的站点;第二类为普通的用户,只能在工作时间访问,且有站点限制,如不能访开心网等;第三类用户,在普通用户受限的基础的上,只能访问公司规定的站点,其余站点都不能访问。
操作:在上次配置的基础上进阶( http://xuchengji.blog.51cto.com/160472/306338
#------------------ proxy  server --------------
#2010-5-10 
#----------------- acl ---------------------------------
acl fann_network src 192.168.0.0/24
acl work_hours time MTWHFAS 07:30-20:30
#               S - Sunday
#               M - Monday
#               T - Tuesday
#               W - Wednesday
#               H - Thursday
#               F - Friday
#               A - Saturday
acl deny_website dstdomain "/usr/lib/squid3/deny_website"
acl allow_website dstdomain "/usr/lib/squid3/allow_website"
#deny_website ,allow_website 分别是要禁止和允许访问的站点
auth_param basic program /usr/lib/squid3/ncsa_auth /usr/lib/squid3/fann_users
#fann_users为公司用户的认证文件,用htpasswd创建
acl normal proxy_auth normal 
acl advanced proxy_auth manager
acl user proxy_auth user
#三类用户分别为manager,nolmal,user
acl manager proto cache_object
 
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 
acl Safe_ports port 80        
# http 
acl Safe_ports port 21        
# ftp 
acl Safe_ports port 443        
# https 
acl Safe_ports port 70        
# gopher 
acl Safe_ports port 210        
# wais 
acl Safe_ports port 1025-65535    
# unregistered ports 
acl Safe_ports port 280        
# http-mgmt 
acl Safe_ports port 488        
# gss-http 
acl Safe_ports port 591   
# filemaker 
acl Safe_ports port 777        
# multiling http 
acl CONNECT method CONNECT
#------------------------------- http_access ------------------
http_access allow advanced
http_access deny !work_hours
http_access deny deny_website
http_access allow normal
http_access deny !allow_website
http_access allow user
http_access allow fann_network
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny all
icp_access deny all
htcp_access deny all
#------------------------------- server -------------------------
http_port 192.168.0.15:808
dns_nameservers 202.96.209.5 202.96.209.133
cache_dir ufs /var/spool/squid3 204800 16 256
hierarchy_stoplist cgi-bin ?
access_log /var/log/squid3/access.log  squid 
cache_log /var/log/squid3/cache.log
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY 
refresh_pattern ^ftp:        1440    20%    10080
refresh_pattern ^gopher:    1440    0%    1440
refresh_pattern .        0    20%    4320
icp_port 3130 
coredump_dir /var/spool/squid3
 
*:建起来很比较容易的,难的是如何维护!

本文转自xcjgutong 51CTO博客,原文链接:http://blog.51cto.com/xuchengji/314059

相关文章
|
1月前
|
Ubuntu JavaScript 关系型数据库
在阿里云Ubuntu 20.04服务器中搭建一个 Ghost 博客
在阿里云Ubuntu 20.04服务器上部署Ghost博客的步骤包括创建新用户、安装Nginx、MySQL和Node.js 18.x。首先,通过`adduser`命令创建非root用户,然后安装Nginx和MySQL。接着,设置Node.js环境,下载Nodesource GPG密钥并安装Node.js 18.x。之后,使用`npm`安装Ghost-CLI,创建Ghost安装目录并进行安装。配置过程中需提供博客URL、数据库连接信息等。最后,测试访问前台首页和后台管理页面。确保DNS设置正确,并根据提示完成Ghost博客的配置。
在阿里云Ubuntu 20.04服务器中搭建一个 Ghost 博客
|
1月前
|
Ubuntu 网络协议 Java
【Android平板编程】远程Ubuntu服务器code-server编程写代码
【Android平板编程】远程Ubuntu服务器code-server编程写代码
|
1月前
|
存储 数据安全/隐私保护 索引
Windows Server 各版本搭建文件服务器实现共享文件(03~19)
Windows Server 各版本搭建文件服务器实现共享文件(03~19)
162 1
|
2月前
|
存储 Ubuntu 网络协议
|
24天前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器
|
1月前
|
存储 Windows
windows server 2019 云服务器看不见硬盘的解决方案
windows server 2019 云服务器看不见硬盘的解决方案
|
1月前
|
数据安全/隐私保护 Windows
Windows Server 各版本搭建终端服务器实现远程访问(03~19)
左下角开始➡管理工具➡管理您的服务器,点击添加或删除角色点击下一步勾选自定义,点击下一步蒂埃涅吉终端服务器,点击下一步点击确定重新登录后点击确定点击开始➡管理工具➡计算机管理,展开本地用户和组,点击组可以发现有个组关门用来远程登录右键这个组点击属性,点击添加输入要添加的用户名,点击确定添加成功后点击确定打开另一台虚拟机(前提是在同一个局域网内),按 WIN + R 输入 mstsc 后回车输入 IP 地址后点击连接输入用户名及密码后点击确定连接成功!
37 0
|
1月前
|
Windows
Windows Server 各版本搭建 Web 服务器实现访问本地 Web 网站(03~19)
Windows Server 各版本搭建 Web 服务器实现访问本地 Web 网站(03~19)
57 2
|
1月前
|
存储 Ubuntu 网络安全
|
1月前
|
Ubuntu 网络协议 Java
在Android平板上使用code-server公网远程Ubuntu服务器编程
在Android平板上使用code-server公网远程Ubuntu服务器编程