TinyProxy 是輕量級 HTTP/HTTPS 代理伺服器,安裝簡單、資源佔用極低,適合個人或小型團隊透過代理存取網路資源。
# 1. 安裝 EPEL 源 (CentOS 5 範例,其他版本請換對應 rpm)
rpm -Uvh https://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# 2. 更新並安裝
yum update
yum install tinyproxy
Port 8888 # 監聽端口,可自行修改
Allow 127.0.0.1 # 僅允許本機,改為你的客戶端 IP (如 Allow 1.2.3.4)
# Allow 192.168.1.0/24 # 支援 CIDR 網段
# Allow all # 前面加 # 註解則允許所有 IP (不建議生產環境)
service tinyproxy start
# 或 systemctl start tinyproxy (CentOS 7)
# 驗證端口監聽
netstat -antup | grep tinyproxy
# 輸出應包含 LISTEN 0.0.0.0:8888
瀏覽器代理設為 伺服器IP:8888,訪問 https://ip.cn 確認出口 IP 為代理伺服器 IP。
Bind 192.168.1.100:指定監聽介面 (多網卡時)Timeout 600:連線逾時秒數MaxClients 100:最大同時連線數ViaProxyName tinyproxy:Via 標頭名稱BasicAuth user password
chkconfig tinyproxy on
# CentOS 7: systemctl enable tinyproxy