玩PT需要SeedBox,關於在CentOS系統下架設SeedBox軟件Transmission

原文轉載自http://www.ziliaoboke.com/pt-seedbox-transmission.html


最近喜歡上了玩PT,喜歡上了高清電影,在大概從4月29號開始起,大概20天的時間慢慢的收集到了中國的五大PT名站之CHD(http://chdbits.org/),HDC(https://hdchina.org/),HDS(http://www.hdstar.org/),HDR(http://hdroad.org/)的帳號,感謝邀請我的朋友們。尤其是CHD,HDC這兩個PT站的帳號,還真是不容易。現在還有最後一個TTG(http://ttg.im/)的PT帳號等着收集。官方網站ttg.im說了在六月一號估計會有百分之一的概率開放註冊。現在就等着那百分之一的概率開放註冊了。PT站多了,尤其是這五大PT名站的帳號多了,而且基本上都有考覈要求,而我又是小水管,想生存得好一點,自然想到了我買的那些又便宜,流量又大的vps,比如說1.04$的hostrail,參考這篇文章《Hostrail繼續便宜實惠vps,每月只要1.05$,大概是7元人民幣,初學者首選》,及directspace的2$及4$的vps,購買鏈接:ds 4$ ds6$。想在上面架設一些seedbox的軟件,實現刷流量,免得被刪除帳號,到時候想下載一些高清電影,就找不到帳號了。下面是在網上所介紹的關於在CentOS系統下架設SeedBox軟件Transmission。當然,在前面我們也介紹了在CentOS系統下架設SeedBox軟件rtorrent,同學們可以去圍觀一下。
下面介紹關於CentOS系統下架設SeedBox軟件Transmission,分兩個版本,一個是英文原版,一個是翻譯的中文版。如果中文版裏有出錯的。建議對照英文版進行理解,尤其是vps命令!
爲什麼我需要一臺 SeedBox ?
我現在的網絡(TPG)最快下載速度爲 1.6MB/S ,但是上傳速度只有 100KB/S 。
看論壇裏別人的 Ratio (分享率)好多都是 2+ 的,上傳都是幾TB,羨慕。
牛B啊,晾騷啊,咱可是用自己的獨立 SeedBox ,下載上傳速度唰唰的。
安裝前的準備:
基本的計算機操作水平,小白退散。
一臺 CentOS (64bit) 系統的服務器或者 VPS ,並且擁有 Root 權限。(當然Debian / Ubuntu 都是可以安裝D)
會使用 Linux 基本的操作命令,會使用 SSH 連接控制服務器。(Windows 平臺推薦 PuTTY ,MAC 下直接在 Terminal 終端裏 SSH 連接即可)。下面請看安裝過程:
安裝
首先通過 SSH 連接軟件,用你的 Root 帳戶登錄你的服務器或者 VPS。
安裝更新軟件Packages
安裝 Transmission 軟件需要運行的各類軟件包,複製粘貼以下命令:
yum -y install gcc gcc-c++ m4 make automake libtool gettext openssl-devel pkgconfig perl-libwww-perl perl-XML-Parser curl curl-devel libevent-devel libevent libidn-devel zlib-devel
以及將系統內的軟件升級爲最新版本:
yum -y upgrade
這可能要花上幾分鐘至幾十分鐘的時間,取決於你使用的服務器的網絡以及性能。
安裝 intltool (國際化工具?這中文翻譯真囧 -w-)
CentOS 系統自帶的 intltool 早已經老化鳥,並且 yum 源裏的 intltool 也很長時間沒更新鳥,所以我們需要自行下載編譯最新版本的 intltool ,複製粘貼以下命令:
cd /usr/local/src
wget http://ftp.gnome.org/pub/gnome/sources/intltool/0.40/intltool-0.40.6.tar.gz
tar zxf intltool-*.tar.gz
cd intltool-*
./configure -prefix=/usr
make -s
make -s install
安裝 Transmission
選 Transmission 爲 SeedBox 的軟件是因爲它的界面很 Mac 很騷,並且對 iPhone / iTouch 甚至我現在用的 BlackBerry 9700 手持設備進行了頁面優化,複製粘貼以下命令:
cd /usr/local/src
wget http://download.m0k.org/transmission/files/transmission-2.13.tar.bz2
tar xjf transmission-*.tar.bz2
cd transmission-*
./configure -prefix=/usr
make -s
make -s install
2010-1-10日更新:代碼中的紅色部分爲Transmission 2.13版本更新,如果以後Transmission升級鳥,你可以到這裏查看最新版本的下載地址。
新建一個爲運行 Transmission 的專有用戶,更安全,更騷:
useradd -m transmission
passwd transmission
(輸入你要設定的密碼,按回車後再輸一遍)
建立 init 文件,使 Transmission 可以在關機、重啓後隨系統開機運行:
wget -O /etc/init.d/transmissiond http://yeasiz.googlecode.com/files/transmission.sh
chmod 755 /etc/init.d/transmissiond
chkconfig --add transmissiond
chkconfig --level 345 transmissiond on

開始和停止 Transmission 守護進程,你應該可以看到2個綠色的[OK] :
service transmissiond start
service transmissiond stop


接着我們需要更改下 Transmission 的默認配置,關閉白名單和開啓用戶認證,請自行修改文中粗體的用戶名(用戶名)和密碼(密碼):
cd /home/transmission/.config/transmission/
sed -i 's/^.*rpc-whitelist-enabled.*/"rpc-whitelist-enabled": false,/' settings.json
sed -i 's/^.*rpc-authentication-required.*/"rpc-authentication-required": true,/' settings.json
sed -i 's/^.*rpc-username.*/"rpc-username": "用戶名",/' settings.json
sed -i 's/^.*rpc-password.*/"rpc-password": "密碼",/' settings.json
創建下載文件存放目錄,給與其相應的寫入讀取權限:
mkdir -p /home/transmission/Downloads/
chown -R transmission.transmission /home/transmission/Downloads/
chmod g+w /home/transmission/Downloads/
至此,所有的安裝項目都結束鳥,讓我們開啓 Transmission 的守護進程吧~
service transmissiond start
安裝後的測試
在瀏覽器中打開下面的地址:

http://你服務器的ip地址:9091/transmission/web/

如圖所示:

英文版如下:
Last updated: April 20, 2011.
Why do I need a seedbox?
Your ISP is blocking or throttling BitTorrent traffic.
The IT department at your work is blocking or throttling BitTorrent traffic.
You have a laptop and it is not practical to keep it running all the time.
You travel a lot and rarely stay online for a significant period of time to download a full torrent.
You are a member of a private torrent site and would like to maintain a good standing aka ratio.
You are tired of overpaying for seedbox hosting at other places.
And last, but not least, you’d like to maintain privacy!
What will I accomplish at the end of this howto?
A Linux box running Transmission BitTorrent client with web based access. Web based access is also optimized for iPhone.
A cross-platform desktop Transmission Remote GUI front end.
FTP access to download completed downloads.
What do I need to begin this guide?
Average computer skills.
Minimal Linux knowledge (basic shell commands).
A dedicated or VPS (Virtual Private Server) running CentOS 5.5 and above. Other similar distros might also work, but haven’t been tested yet. Your Linux distro needs to have a yum package manager.
SSH client (e.g. PuTTY on a Windows machine; Terminal on a Mac machine)
Ten minutes of your time. I was actually able to set this one up in under 4 minutes during one of the tests.
If you don’t have a server yet, don’t worry. Unless you are a very heavy-duty user, you probably won’t need a dedicated server. If you are unsure, go with a VPS.
KnowinServers (affiliate link) and diyseedbox.com teamed up to offer you an offshore VPS solution. The hosting is perfectly suitable for this tutorial and for amazingly low price of just under $9/month. It can get even cheaper with a longer commitment! For an extra $5 you can get unmetered 100 Mbps connection. The servers are located in Germany. The deal is only available by going through the link provided. Instant setup! Wow, can it get better than this?
Installation
I assume that you have obtained your server credentials (username and password) by now. Login to your server using the SSH client.
Installing prerequisites
First we are going to install a bunch of prerequisite software packages that we will need during the course of this tutorial. Issue the following command:
yum -y install gcc gcc-c++ make openssl-devel pkgconfig curl-devel perl-XML-Parser perl-libwww-perl gettext
yum -y upgrade
This installation might take a minute or two, depending on your server specs and connection speed.
Installing intltool
CentOS intltool package is out of date and a recent version is not available through the package manager. We must compile it from source. Don’t quit now. This isn’t as scary as it sounds.
cd /usr/local/src
wget -q http://ftp.gnome.org/pub/gnome/sources/intltool/0.40/intltool-0.40.6.tar.gz
tar zxf intltool-*.tar.gz
cd intltool-*
./configure –prefix=/usr
make -s
make -s install
Installing libevent
CentOS libevent package is out of date, just like intltool, so we resort to installing the latest version by hand.
cd /usr/local/src
wget -q http://monkey.org/~provos/libevent-2.0.10-stable.tar.gz
tar zxf libevent-*.tar.gz
cd libevent-*
./configure –prefix=/usr
make -s
make -s install
Installing Transmission
Transmission is the actual torrent application that you will be using. Again, just copy paste the commands into the SSH client window.
cd /usr/local/src
wget -q http://download.m0k.org/transmission/files/transmission-2.22.tar.bz2
tar xjf transmission-*.tar.bz2
cd transmission-*
./configure –prefix=/usr –disable-gtk –disable-libappindicator –disable-libcanberra –disable-gconf2 LIBEVENT_CFLAGS=-I/usr/include LIBEVENT_LIBS=”-L/usr/lib -levent”
make -s
make -s install
Add a user account for running the Transmission daemon application. You will be prompted to create a password. You will use that password to login and obtain the files that have been downloaded. Try to remember the password or write it down.
useradd -m transmission
passwd transmission
Create init script for starting the daemon. Adapted from Jason Friedland’s implementation.
wget -O /etc/init.d/transmissiond http://pastie.org/pastes/962731/download
chmod 755 /etc/init.d/transmissiond
Set the Transmission daemon to start automatically when the server is restarted:
chkconfig –add transmissiond
chkconfig –level 345 transmissiond on
Start and stop the Transmission daemon. You must do this before proceeding to the next step. This ensures that everything up to now has been installed properly. Most important, this creates a default configuration file that we will be editing later on. You should see two green [OK] outputs after the completion.
service transmissiond start
service transmissiond stop
Now we need to modify the Transmission configuration file. Replace the bold/underlined portion of the last two commands with your own username and password combination. You’ll use this to login to Transmission application.
cd /home/transmission/.config/transmission/
sed -i ‘s/^.*rpc-whitelist-enabled.*/”rpc-whitelist-enabled”: false,/’ settings.json
sed -i ‘s/^.*rpc-authentication-required.*/”rpc-authentication-required”: true,/’ settings.json
sed -i ‘s/^.*rpc-username.*/”rpc-username”: “username”,/’ settings.json
sed -i ‘s/^.*rpc-password.*/”rpc-password”: “password”,/’ settings.json
Create a directory for storing downloads:
mkdir -p /home/transmission/Downloads/
chown -R transmission.transmission /home/transmission/Downloads/
chmod g+w /home/transmission/Downloads/
Finally start the Transmission daemon for good:
service transmissiond start
Installing ConfigServer Security & Firewall application
We are also going to install a ConfigServer Security & Firewall application. This application will help your server to stay secure and also ensure that the necessary ports are open for Transmission to function properly. This is an important step, please do not skip it. Hosting providers have different configurations of the default CentOS install and may block certain ports. This installation will ensure that the necessary ports are open and unnecessary ones remain closed.
cd /usr/local/src
wget http://www.configserver.com/free/csf.tgz
tar zxf csf.tgz
rm -f csf.tgz
cd csf
./install.generic.sh
Now that we have CSF installed, we’ll issue a few commands to “doctor” the configuration file and open/close some ports.
cd /etc/csf
sed -i ‘s/^TESTING =.*/TESTING = “0″/’ csf.conf
sed -i ‘s/^TCP_IN =.*/TCP_IN = “21,22,9091,51413,30000:35000″/’ csf.conf
sed -i ‘s/^TCP_OUT =.*/TCP_OUT = “1:65535″/’ csf.conf
sed -i ‘s/^UDP_IN =.*/UDP_IN = “20,21,51413″/’ csf.conf
sed -i ‘s/^UDP_OUT =.*/UDP_OUT = “1:65535″/’ csf.conf
service csf restart
Testing your installation
By now you should have the Transmission daemon running and FTP server setup. Let’s go play!
Testing Transmission
Open the following URL in a new browser tab/window:

http://[YOUR_SERVER_IP]:9091/transmission/web/

You will be prompted to enter a username and password. Use the same username and password you have created during the Transmission installation (the second one). Once logged in, you should see a Transmission web interface. Click “Open” and copy-paste the following URL to test the download functionality and speed:

http://ftp.osuosl.org/pub/centos/5.5/isos/x86_64/CentOS-5.5-x86_64-LiveCD.torrent

You should now see the download status bar increasing.
Testing SFTP Connection
Download, install and open FileZilla. Go to File -> Site Manager. Click “New Site“. Give it a good name. Under “Host” field put the server name (if you have one), or simply the IP of the server. Choose SFTP under “Server Type“. “Logon Type” set to “Normal”. Set the user to “transmission” and the password you have created during Transmission installation (the first one). Now click “Connect“, you should see FileZilla establishing the connection and then finally listing remote directories in the right hand side part of the window. You should see “Downloads” directory, this is where all of the download files will be stored.
Setting up Transmission Remote GUI
This is my favourite part about this whole setup. Not only you get a nice and fast web based client, but you can also set this up to be used with the desktop application! If you are migrating from µTorrent, then you’ll love this!
Head over to the Transmission Remote GUI project page and download a copy of the client. Install the software.
Once you have it open:
Go to menu Torrents and select “Connect to daemon“.
Enter the server IP into the “Remote host” field. Make sure not to put the whole URL (http://….), just put the IP part (e.g. “123.45.67.89″).
Enter 9091 into the “Port” field.
Enter your username and password you have set during the Transmission installation (the second one).
Click “OK”.
Your desktop software should now be “talking” to your server. Note that this software only shows the status of the downloads, but you can’t actually access files through that UI. You still need to use the FTP client to download the completed torrents.
Updates
April 20, 2011: Trimmed yum package list, added libevent instructions, updated to Transmission 2.22.
November 2, 2010: Updated to Transmission 2.11.
October 4, 2010: Added which to the list packages to install. Some people reported that missing on their systems.
September 29, 2010: Modified the tutorial to save source code to /usr/local/src, rather than /tmp to avoid configurations with noexec on /tmp. Got rid of vsftpd FTP server all together in favour of SCP/SFTP approach (thanks to P. Callisto’s suggestion). Disabled the verbose mode on tar and silented the make.
August 30, 2010: Added libidn-devel and zlib-devel packages per Kristen’s suggestion.
August 10, 2010: Updated to Transmission 2.04.
July 7, 2010: Updated tutorial to Transmission 2.01. Added libevent-devel and libevent to yum command.(原文:1980y diyseedbox


發佈了17 篇原創文章 · 獲贊 5 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章