基於TinyProxy搭建HTTPProxy 伺服器

來源:互聯網
上載者:User

基於TinyProxy搭建HTTPProxy 伺服器 一、前言    關於為什麼要玩玩HTTP代理就不用我多說了。 二、搭建環境    * Linux laptop 2.6.32-45-generic #100-Ubuntu SMP Wed Nov 14 10:41:11 UTC 2012 i686 GNU/Linux    * tinyproxy 1.8.1 三、安裝方法    $sudo apt-get install tinyproxy    安裝後自動以root許可權開啟了tinyproxy服務,且預設監聽連接埠是8888 四、啟動協助    $tinyproxy --help    Usage: tinyproxy [options]    Options are:      -d        Do not daemonize (run in foreground).      -c FILE   Use an alternate configuration file.      -h        Display this usage information.      -l        Display the license.      -v        Display version information. 五、根使用者的啟動方法    * 預設啟動    $sudo service tinyproxy start        * 重啟    $sudo service tinyproxy restart        * 停止    $sudo service tinyproxy stop 六、DIY配置    4.1 預設設定檔位置        /etc/tinyproxy.conf         (可以從/etc/init.d/tinyproxy封裝器指令碼中查到)        4.2 預設配置說明        * 以根使用者啟動時,在初始化完成後切換uid/gid為nobody/nogroup        * Port 預設監聽連接埠為8888(該連接埠無需用root許可權綁定)        * 預設在所在網卡上監聽        * Logfile (必須)記錄檔, 預設/usr/var/log/tinyproxy/tinyproxy.log,在LogFile檔案不存在時會警告,不會運行失敗。        * Pidfile (必須)pid檔案, 預設/usr/var/run/tinyproxy/tinyproxy.pid,在PidFile檔案不存在時會運行失敗。        * StartServers 初始啟動的Proxy 伺服器子進程(預設是10個)      *** Allow 允許使用tinyproxy進行HTTP代理的IP地址。預設是127.0.0.1,如果想要公開tinyproxyProxy 伺服器,則把Allow一行注釋掉。            4.3 Diy配置說明        tinyproxy可以以普通使用者權限運行,只要監聽連接埠是公開的就可以了。具體Diy配置方法如下:        -- 打包可執行程式與預設設定檔 --        1. $which tinyproxy           /usr/sbin/tinyproxy        2. $cp /usr/sbin/tinyproxy ~/bin        3. $cp /etc/tinyproxy.conf ~/etc         -- 修改配置 --        1. 將Port預設的8888改成你想要的連接埠(如ljysrv上面的8990 TCP連接埠)        2. 將Allow 127.0.0.1注釋掉        3. 將Logfile改為/tmp/tinyproxy.log        4. 將PidFile改為/tmp/tinyproxy.pid                -- 啟動 --        1. $cd ~/bin        2. $./tinyproxy -c ~/etc/tinyproxy.conf         -- 關閉 --        1. $killall tinyproxy 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.