CentOS下搭建http代理服务器(TinyProxy)

本文主要介绍Centos6.x搭建TinyProxy服务器。

1.安装

1
2
# yum install epel-release -y
# yum install tinyproxy -y

2.配置

配置文件:/etc/opt/ss5/ss5.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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 127.0.0.1
ViaProxyName "tinyproxy"
ConnectPort 443
ConnectPort 563

参数:
Port是监听的端口
Allow IP服务限制。如果不想限制,可以注释掉

3.启动

1
2
3
4
5
# service tinyproxy start

# chkconfig --level 35 tinyproxy on

# netstat -ntlp | grep tinyproxy
---------------- The End ----------------