Loading... <h4>一、前言</h4> <p>关于为什么要玩玩HTTP代理就不用我多说了。 </p> <h4><a name="t1"></a>二、搭建环境</h4> <p>* Linux Ubuntu </p> <p>* tinyproxy</p> <h4><a name="t2"></a>三、安装方法</h4> <p>$sudo apt-get install tinyproxy <br />安装后自动以root权限开启了tinyproxy服务,且默认监听端口是8888</p> <h4><a name="t3"></a>四、启动帮助</h4> <p>$tinyproxy --help <br />Usage: tinyproxy [options] <br />Options are: <br />-d Do not daemonize (run in foreground). <br />-c FILE Use an alternate configuration file. <br />-h Display this usage information. <br />-l Display the license. <br />-v Display version information.</p> <h4><a name="t4"></a>五、根用户的启动方法</h4> <p>* 默认启动 <br />$sudo service tinyproxy start <br />* 重启 <br />$sudo service tinyproxy restart <br />* 停止 <br />$sudo service tinyproxy stop</p> <h4><a name="t5"></a>六、DIY配置</h4> <h5><a name="t6"></a>4.1 默认配置文件位置</h5> <p>/etc/tinyproxy.conf</p> <p>(可以从/etc/init.d/tinyproxy包装器脚本中查到)</p> <h5><a name="t7"></a>4.2 默认配置说明</h5> <p>* 以根用户启动时,在初始化完成后切换uid/gid为nobody/nogroup <br />* Port 默认监听端口为8888(该端口无需用root权限绑定) <br />* 默认在所在网卡上监听 <br />* Logfile (必须)日志文件, 默认/usr/var/log/tinyproxy/tinyproxy.log,在LogFile文件不存在时会警告,不会运行失败。 <br />* Pidfile (必须)pid文件, 默认/usr/var/run/tinyproxy/tinyproxy.pid,在PidFile文件不存在时会运行失败。 <br />* StartServers 初始启动的代理服务器子进程(默认是10个) <br />*** Allow 允许使用tinyproxy进行HTTP代理的IP地址。默认是127.0.0.1,如果想要公开tinyproxy代理服务器,则把Allow一行注释掉。</p> <h5><a name="t8"></a>4.3 Diy配置说明</h5> <p>tinyproxy可以以普通用户权限运行,只要监听端口是公开的就可以了。具体Diy配置方法如下: <br />-- 打包可执行程序与默认配置文件 -- <br />1. $which tinyproxy <br />/usr/sbin/tinyproxy <br />2. $cp /usr/sbin/tinyproxy ~/bin <br />3. $cp /etc/tinyproxy.conf ~/etc <br />-- 修改配置 -- <br />1. 将Port默认的8888改成你想要的端口(如ljysrv上面的8990 TCP端口) <br />2. 将Allow 127.0.0.1注释掉 <br />3. 将Logfile改为/tmp/tinyproxy.log <br />4. 将PidFile改为/tmp/tinyproxy.pid <br />-- 启动 -- <br />1. $cd ~/bin <br />2. $./tinyproxy -c ~/etc/tinyproxy.conf <br />-- 关闭 -- <br />1. $killall tinyproxy</p> Last modification:October 6, 2023 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 如果觉得我的文章对你有用,请随意赞赏
2 comments
对这个不懂
路过来瞧瞧