CentOS TinyProxy http(s)上网代理及置代理上网的方法

TinyProxy不能作FQ,因为客户端与TinyProxy之间的数据是没有加密的

服务端:

外网卡:xxx.xxx.x.xx  有网关,可访问外网

内网卡:192.168.3.10  无网关

 

 安装方法:

yum -y install epel-release

yum -y install tinyproxy

  

配置:

vi /etc/tinyproxy/tinyproxy.conf

Port 8888 //预设是8888 Port,你可以更改

Allow 127.0.0.1 //将127.0.0.1改成你自己的IP

//Allow 192.168.1.0/24    #表示一个网络的IP

//例如你的IP 是1.2.3.4,你改成Allow 1.2.3.4,那只有你才可以连上这个Proxy

//若你想任何IP都可以连到Proxy在Allow前面打#注释

[root@localhost ~]# egrep -v "^#|^$" /etc/tinyproxy/tinyproxy.conf
User tinyproxy
Group tinyproxy
Port 8888
Timeout 600
DefaultErrorFile "/usr/share/tinyproxy/default.html"
StatFile "/usr/share/tinyproxy/stats.html"
LogFile "/var/log/tinyproxy/tinyproxy.log"
LogLevel Info
PidFile "/var/run/tinyproxy/tinyproxy.pid"
MaxClients 100
MinSpareServers 5
MaxSpareServers 20
StartServers 10
MaxRequestsPerChild 0
Allow 192.168.3.0/24
ViaProxyName "tinyproxy"
ConnectPort 443
ConnectPort 563

启动服务

chkconfig tinyproxy on

service tinyproxy start

centos服务器设置代理上网的方法

这里以centos7.0为例,记录代理服务器设置过程:

1.全局的代理设置:

vi /etc/profile

添加下面内容(若无密码则不填写@和@之前的用户名密码字段)

export http_proxy=http://192.168.3.10:8888/
export ftp_proxy=http://192.168.3.10:8888/

格式如下:

export http_proxy=http://username:password@yourproxy:8888/

export ftp_proxy=http://username:password@yourproxy:8888/

最后执行 . /etc/profile  使配置生效

2.yum的代理设置:

vi /etc/yum.conf

 添加下面内容

http_proxy=http://192.168.3.10:8888/
ftp_proxy=http://192.168.3.10:8888/

 proxy=http://username:password@yourproxy:8888/

 或者

proxy=http://yourproxy:8888

proxy=ftp://yourproxy:8888

proxy_username=username

proxy_password=password

3.Wget的代理设置:

vi /etc/wgetrc

 添加下面内容

 # Proxy

http_proxy=http://192.168.3.10:8888/
ftp_proxy=http://192.168.3.10:8888/

http_proxy=http://username:password@proxy_ip:port/

ftp_proxy=http://username:password@proxy_ip:port/

 安装方法:

yum -y install epel-release

yum -y install tinyproxy

  

配置:

vi /etc/tinyproxy/tinyproxy.conf

Port 8888 //预设是8888 Port,你可以更改

Allow 127.0.0.1 //将127.0.0.1改成你自己的IP

//Allow 192.168.1.0/24    #表示一个网络的IP

//例如你的IP 是1.2.3.4,你改成Allow 1.2.3.4,那只有你才可以连上这个Proxy

//若你想任何IP都可以连到Proxy在Allow前面打#注释

[root@localhost ~]# egrep -v "^#|^$" /etc/tinyproxy/tinyproxy.conf
User tinyproxy
Group tinyproxy
Port 8888
Timeout 600
DefaultErrorFile "/usr/share/tinyproxy/default.html"
StatFile "/usr/share/tinyproxy/stats.html"
LogFile "/var/log/tinyproxy/tinyproxy.log"
LogLevel Info
PidFile "/var/run/tinyproxy/tinyproxy.pid"
MaxClients 100
MinSpareServers 5
MaxSpareServers 20
StartServers 10
MaxRequestsPerChild 0
Allow 192.168.3.0/24
ViaProxyName "tinyproxy"
ConnectPort 443
ConnectPort 563

启动服务

chkconfig tinyproxy on

service tinyproxy start

centos服务器设置代理上网的方法

这里以centos7.0为例,记录代理服务器设置过程:

1.全局的代理设置:

vi /etc/profile

添加下面内容(若无密码则不填写@和@之前的用户名密码字段)

export http_proxy=http://192.168.3.10:8888/
export ftp_proxy=http://192.168.3.10:8888/

格式如下:

export http_proxy=http://username:password@yourproxy:8888/

export ftp_proxy=http://username:password@yourproxy:8888/

最后执行 . /etc/profile  使配置生效

2.yum的代理设置:

vi /etc/yum.conf

 添加下面内容

http_proxy=http://192.168.3.10:8888/
ftp_proxy=http://192.168.3.10:8888/

 proxy=http://username:password@yourproxy:8888/

 或者

proxy=http://yourproxy:8888

proxy=ftp://yourproxy:8888

proxy_username=username

proxy_password=password

3.Wget的代理设置:

vi /etc/wgetrc

 添加下面内容

 # Proxy

http_proxy=http://192.168.3.10:8888/
ftp_proxy=http://192.168.3.10:8888/

http_proxy=http://username:password@proxy_ip:port/

ftp_proxy=http://username:password@proxy_ip:port/

猜你喜欢

转载自www.cnblogs.com/eos666/p/10777440.html
今日推荐