Ubuntu设置squid代理
生活随笔
收集整理的這篇文章主要介紹了
Ubuntu设置squid代理
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.安裝squid
sudo apt-get install squid?
2,修改配置,增加需要使用代理的ip
vi命令修改: vi?/etc/squid/squid.conf?
圖形界面編輯?sudo gedit /etc/squid/squid.conf?
1) 定位到 # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS # Example rule allowing access from your local networks. Adapt # to list your (internal) IP networks from where browsing should # be allowed #acl our_networks src 192.168.1.0/24 192.168.2.0/24 #http_access allow our_networks http_access allow localhost ########add 需要使用代理的ip acl my_network src 192.168.0.133 192.168.0.122 #這里加了兩個ip http_access allow my_network #########end add # And finally deny all other access to this proxy http_access deny all-----------------------------------
2)端口可以不修改(默認3128)。
3,初始化配置
1>當設置好SQUID.CONF文件之后,第一次執行SQUID之前,記住先用命令squid -z制作緩沖區目錄
squid -z
2>如果對SQUID.CONF配置文件做了修訂之后,通常采用重新讀取配置文件的方式,以確保SQUID持續提供服務。
service squid restart
3>關閉squid
squid -k kill ? ?直接停止服務
squid -k shutdown ??關閉LOG后停止服務
4>檢查squid狀態
squid -k check ?檢查SQUID?是否正常運行
?
參考:?http://blog.chinaunix.net/uid-20778906-id-540115.html
?http://blog.csdn.net/zinking3/article/details/1653897
轉載于:https://www.cnblogs.com/antoon/p/4496904.html
總結
以上是生活随笔為你收集整理的Ubuntu设置squid代理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 初探Git git基本用法
- 下一篇: Java 基础【12】 日期类型