顯示具有 proxy 標籤的文章。 顯示所有文章
顯示具有 proxy 標籤的文章。 顯示所有文章

2016年10月3日 星期一

ubuntu 16.04 squid

https://help.ubuntu.com/16.04/serverguide/squid.html

Installation

At a terminal prompt, enter the following command to install the Squid server:
sudo apt install squid3

Configuration

Squid is configured by editing the directives contained within the /etc/squid3/squid.conf configuration file. The following examples illustrate some of the directives which may be modified to affect the behavior of the Squid server. For more in-depth configuration of Squid, see the References section.
Prior to editing the configuration file, you should make a copy of the original file and protect it from writing so you will have the original settings as a reference, and to re-use as necessary. Make this copy and protect it from writing using the following commands:
sudo cp /etc/squid3/squid.conf /etc/squid3/squid.conf.original
sudo chmod a-w /etc/squid3/squid.conf.original
  • To set your Squid server to listen on TCP port 8888 instead of the default TCP port 3128, change the http_port directive as such:
    http_port 8888
    
  • Change the visible_hostname directive in order to give the Squid server a specific hostname. This hostname does not necessarily need to be the computer's hostname. In this example it is set to weezie
    visible_hostname weezie
    
  • Using Squid's access control, you may configure use of Internet services proxied by Squid to be available only users with certain Internet Protocol (IP) addresses. For example, we will illustrate access by users of the 192.168.42.0/24 subnetwork only:
    Add the following to the bottom of the ACL section of your /etc/squid3/squid.conf file:
    acl fortytwo_network src 192.168.42.0/24
    
    Then, add the following to the top of the http_access section of your /etc/squid3/squid.conf file:
    http_access allow fortytwo_network
    
  • Using the excellent access control features of Squid, you may configure use of Internet services proxied by Squid to be available only during normal business hours. For example, we'll illustrate access by employees of a business which is operating between 9:00AM and 5:00PM, Monday through Friday, and which uses the 10.1.42.0/24 subnetwork:
    Add the following to the bottom of the ACL section of your /etc/squid3/squid.conf file:
    acl biz_network src 10.1.42.0/24
    acl biz_hours time M T W T F 9:00-17:00
    
    Then, add the following to the top of the http_access section of your /etc/squid3/squid.conf file:
    http_access allow biz_network biz_hours
    
After making changes to the /etc/squid3/squid.conf file, save the file and restart the squid server application to effect the changes using the following command entered at a terminal prompt:
sudo systemctl restart squid3.service

2016年6月2日 星期四

Squid3 ubuntu



Squid3 安裝


http://www.ez2o.com/Blog/Post/Ubuntu-Install-Proxy-Server-Squid


apt-get install squid

vi /etc/squid3/squid.conf

設定允許所有人連入 Proxy :

將 http_access allow localhost  改為 http_access allow all

將 http_access deny all 註解

/etc/init.d/squid restart

在 Wget 使用 proxy


Via ~/.wgetrc file:
use_proxy=yes http_proxy=127.0.0.1:8080
or
via -e options placed after the URL:
wget ... -e use_proxy=yes -e http_proxy=127.0.0.1:8080 ...

用 ftp proxy 的時候 用 -e ftp_proxy=127.0.0.1:8080


在 yum 使用 proxy



$ export http_proxy=http://proxy:3128
$ export ftp_proxy=http://proxy:3128
$ yum update
If you want to make the proxy settings permanent, you can add a proxy directive to /etc/yum.conf:
$ grep proxy /etc/yum.conf
proxy=http://proxy:3128











=END