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

相关文章
|
5天前
|
Ubuntu Android开发 数据安全/隐私保护
【Android平板编程】远程Ubuntu服务器Code-Server编程写代码
【Android平板编程】远程Ubuntu服务器Code-Server编程写代码
|
7天前
|
网络协议 安全
ensp中nat server 公网访问内网服务器
ensp中nat server 公网访问内网服务器
|
13天前
|
Ubuntu 网络安全 数据安全/隐私保护
使用SSH隧道将Ubuntu云服务器Jupyter Notebook端口映射到本地
这样,你就成功地将Ubuntu云服务器上的Jupyter Notebook端口映射到本地,使你能够通过本地浏览器访问并使用Jupyter Notebook。
36 1
|
14天前
|
网络协议 Windows
Windows Server 各版本搭建 DNS 服务器实现域名正反向解析
Windows Server 各版本搭建 DNS 服务器实现域名正反向解析
|
20天前
|
存储 网络协议 Ubuntu
Ubuntu14.04快速搭建SVN服务器及日常使用
Ubuntu14.04快速搭建SVN服务器及日常使用
|
1月前
|
Ubuntu Linux 虚拟化
【Linux】ubuntu安装samba服务器
【Linux】ubuntu安装samba服务器
|
2月前
|
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 博客
|
2月前
|
弹性计算 运维 监控
slb后端服务器组(Backend Server Group)关联
阿里云SLB的后端服务器组提供逻辑分组、精细化路由、端口隔离、权重分配与会话保持等功能,便于资源管理、流量控制和故障隔离。通过监听规则、健康检查、标签和API关联,实现灵活的后端资源配置,适应多变的业务需求,确保服务稳定性和资源利用率。
22 1
|
2月前
|
Ubuntu 网络协议 Java
【Android平板编程】远程Ubuntu服务器code-server编程写代码
【Android平板编程】远程Ubuntu服务器code-server编程写代码
|
2月前
|
存储 Windows
windows server 2019 云服务器看不见硬盘的解决方案
windows server 2019 云服务器看不见硬盘的解决方案