在VPS上安裝BT軟體Transmission

VPS 還能怎玩?! 裝Proxy,裝VPN,這還不夠,我還用來掛種子夠狠吧 XD 反正頻寬閒也是閒者,不過安裝前最好事先問問主機商是否允許,合法的文件大多都是OK的。偶用YUM裝了幾個軟體總覺都怪怪的,畢竟不是該軟體最新的版本,再加上CentOS是一套強調安全的系統,當然對P2P這玩意不會太支援,我裝過了純網頁介面的Torrentflux,很多人推薦的rTorrent,但是最後還是選擇了Transmission (Y)

Transmission是一套Linux底下的BT Client,除了有繁體中文介面、支援UTF-8、介面簡潔又漂亮、佔用資源少之外也有很多熱心人士寫方便的外掛加強他的方便性,程式本身支援DHT、PEX,也能加密以及線上更新黑名單功能,可以在桌面運行也可以在console下跑,並且內建了網頁管理模組,完全不需要架設伺服器,裝好Transmission就可以遠端控制了! ;)

這邊簡單滴把安裝過程做個紀錄,環境是CentOS 5.5的系統,開始自己編譯吧! :-#

*********更新歷史*********

2009/12/04 - 首次發表
2010/09/22 - 更新版本為1.93
2010/10/17 - 更新版本為2.10(已增加CentOS專用的啟動腳本)
2010/11/12 - 更新版本為2.11(好像跑的快一點)
2010/11/22 - 更新版本為2.12(主要應該是修正了偶而程式會突然耍冷當掉,其他更新了什麼看這吧→官網維基)
2011/10/20 - 更新版本為2.41

Step.1 首先安裝基本套件

如果沒有安裝rpmforge跟EPEL這2個官方認可的第三方套件庫的話就要手動安裝perl-XML-Parser唷!所以要記得先安裝。

i386 / 32位元

rpm --import http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL-5
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -ihv http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -ihv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm

x84_64 / 64位元

rpm --import http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL-5
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -ihv http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -ihv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

然後開始利用YUM做簡便安裝,指令就下面這串啦 :P

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 which

Step.2 下載Transmission以及必備套件然後開始安裝

cd /usr/src
wget http://ftp.gnome.org/pub/gnome/sources/intltool/0.40/intltool-0.40.6.tar.gz
wget http://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz
wget http://download.transmissionbt.com/files/transmission-2.41.tar.bz2

這邊開始要按照順序安裝唷!

tar zxf libiconv-*.tar.gz
cd libiconv-*
./configure --prefix=/usr/local/libiconv
make && make install
cd ..

tar zxf intltool-*.tar.gz
cd intltool-*
./configure --prefix=/usr
make -s
make -s install
cd ..

tar xjf transmission-*.tar.bz2
cd transmission-*
/sbin/ldconfig
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
./configure --prefix=/usr --enable-lightweight
make -s
make -s install
cd ..

Step.3 再來新增Transmission啟動腳本要用到的使用者,***密碼部分要輸入兩次!***

useradd transmission
passwd transmission

Step.4 建立 Transmission 的設定檔目錄以及下載目錄

mkdir -p /usr/local/transmission/
mkdir -p /web/www/transmission/incomplete/
chown -R www:www /web/www/transmission/
chmod 777 /web/www/transmission/

Step.5 啟動Transmission產生Transmission的設定檔 ***此步驟要執行2次***

/usr/bin/transmission-daemon -g /usr/local/transmission
killall transmission-daemon

Step.6 編輯Transmission設定檔,這邊我有把遠控的port改成5566。

cp /usr/local/transmission/settings.json /usr/local/transmission/settings.json.bak
vi /usr/local/transmission/settings.json

比較重要的設定如下:

"download-dir": "/web/www/transmission",, // 下載完成儲存的位置
"incomplete-dir": "/web/www/transmission/incomplete",, // 尚未下載完成儲存的位置
"blocklist-enabled": true, // 啟用黑名單
"dht-enabled": true, // 啟用DHT支援
"encryption": 1, // 傳輸加密
"open-file-limit": 64, // 最大開啟檔案數量
"peer-limit-global": 240, // 最大連接數
"peer-limit-per-torrent": 60, // 單一任務連接數
"peer-port": 59999, // Transmission連接使用的port
"ratio-limit": 2.0000, // 上下傳比例達到多少停止做種
"ratio-limit-enabled": false, // 啟用上下傳比例
"rpc-enabled": true, // 啟用網頁管理模組
"rpc-bind-address": "0.0.0.0", // 指定IP位置
"rpc-port": 5566, // 指定網頁管理模組的port
"rpc-authentication-required": true, // 啟用使用者認證方式
"rpc-username": "lulala", // 登入的使用者名稱
"rpc-password": "balala", // 登入的使用者密碼
"rpc-whitelist-enabled": false, // 啟用IP認證模式,這個模式是認IP的唷! 有安全需要再啟動
"rpc-whitelist": "127.0.0.1,其他可以連的IP", // 指定認可的IP位置,以,區隔
"speed-limit-down": 100, // 限制下載速度,以KB/Sec計算
"speed-limit-down-enabled": false, // 啟用限制下載速度
"speed-limit-up": 100, // 限制上傳速度,以KB/Sec計算
"speed-limit-up-enabled": false, // 啟用限制上傳速度
"upload-slots-per-torrent": 30 // 每個Torrent的上傳連接數量,台灣跛腳的網路請設10

如果是用在動物機上開啟檔案數量和連接數就不可以調太高,免得負載太高而罷工,除了以上的設定值之外其他參數也可以參考官網的維基都有說明

Step.7 最後在編輯一下iptables規則,加入Transmission使用的port

/etc/init.d/iptables stop
iptables -A INPUT -p tcp --dport 5566 -j ACCEPT
iptables -A INPUT -p tcp --dport 59999:61000 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart

Step.8 全部搞定了,然後新增一個Transmission啟動腳本,內容如下

vi /etc/init.d/transmission

CODE:
  1. #!/bin/bash
  2. #
  3. # chkconfig: - 16 84
  4. # description: Start up transmission-daemon
  5. #
  6. # processname: transmission-daemon
  7. # config: /etc/sysconfig/transmission
  8.  
  9. # source function library
  10. . /etc/rc.d/init.d/functions
  11.  
  12. # Get network config
  13. . /etc/sysconfig/network
  14.  
  15. [ "${NETWORKING}" = "no" ] && exit 0
  16.  
  17. # Defaults
  18. TRANSMISSION_HOME=/usr/bin/transmission-daemon
  19.  
  20. DAEMON_USER="transmission"
  21. DAEMON_ARGS="-g /usr/local/transmission"
  22.  
  23. # Daemon
  24. NAME=transmission-daemon
  25.  
  26. DAEMON=$(which $NAME)
  27. DAEMON_PIDFILE=/var/run/$NAME.pid
  28. DAEMON_LOCKFILE=/var/lock/subsys/$NAME
  29. DAEMON_SCRIPTNAME=/etc/init.d/$NAME
  30. DAEMON_LOGFILE=/var/log/$NAME.log
  31.  
  32. [ -x "$DAEMON" ] || exit 0
  33.  
  34. start() {
  35.     echo -n $"Starting ${NAME}: "
  36.  
  37.     if [ -n "$TRANSMISSION_HOME" ]; then
  38.         export TRANSMISSION_HOME
  39.     fi
  40.  
  41.     su - $DAEMON_USER -c "$DAEMON $DAEMON_ARGS"
  42.  
  43.     sleep 2
  44.  
  45.     status $NAME &> /dev/null && echo_success || echo_failure
  46.     RETVAL=$?
  47.  
  48.     if [ $RETVAL -eq 0 ]; then
  49.         touch $DAEMON_LOCKFILE
  50.         pidof -o %PPID -x $NAME> $DAEMON_PIDFILE
  51.     fi
  52.  
  53.     echo
  54. }
  55.  
  56. stop() {
  57.     echo -n $"Shutting down ${NAME}: "
  58.  
  59.     killproc $NAME
  60.     RETVAL=$?
  61.  
  62.     [ $RETVAL -eq 0 ] && /bin/rm -f $DAEMON_LOCKFILE $DAEMON_PIDFILE
  63.  
  64.     echo
  65. }
  66.  
  67. case "$1" in
  68.     start)
  69.         start
  70.     ;;
  71.     stop)
  72.         stop
  73.     ;;
  74.     restart)
  75.         stop
  76.         start
  77.     ;;
  78.     status)
  79.         status $NAME
  80.     ;;
  81.  
  82.     *)
  83.         echo "Usage: $SCRIPTNAME {start|stop|restart|status}">&2
  84.         exit 3
  85.     ;;
  86. esac

然後給權限,啟動之後打開瀏覽器輸入http://IP或域名:5566/就能遠控Transmission了。 (H)

chmod +x /etc/init.d/transmission
chkconfig --level 345 transmission on
chown -R transmission:transmission /usr/local/transmission/
service transmission start

測試完畢,打包收工啦! (F)

cd /usr/src
rm -rf libiconv-*
rm -rf intltool-*
rm -rf transmission-*

- 下載Transmission啟動腳本範本檔
- 下載Transmission設定檔範本檔
- 搭配FlexGet來實現讀取RSS自動下載功能

--------------

Transmission除了網頁介面之外還有非常好用的遠控軟體,我現在就是在用transmission-remote-dotnet(需要加裝 Microsoft .NET Framework 2.0)來搭配使用,transmission-remote-dotnet這套雖然只有支援Win系列的OS,但是有支援UTF-8,就算是簡體中文的檔名也能正確的顯示,而且掛10幾個種子也只吃20多MB記憶體。 :)

transmission-remote-dotnet

另外transmisson-remote-gui這套提供了Mac OS、Windows、Linux-i386 binary、Source code,不過這套沒有中文介面,不支援UTF-8,我使用時中文都會變亂碼。 +o(

其他的Transmission使用教學

圖解 Transmission 入門
Transmission安裝方法
推薦好用的多平台BT工具

相關文章


在VPS上安裝BT軟體Transmission目前有 53 個評論

  1. 上週五買了那個1個月free的promotion,最後也是要£1.00GBP,約48NTD GY GY .

    但是最不爽的是等等等...等不到服務開通,ticket也不回
    聽說是Service delivery 要 24-72 business hours,我哩咧.
    上次買也沒那麼久,難道便宜沒好貨? :kao :kao

    算了,看在純粹刷上傳量的份上,忍耐一點

  2. Pingback: 沒有牆的世界 bt -網誌熱搜"沒有牆的世界 bt"

  3. [root@tuxin libiconv-1.13.1]# cd ..

    [root@tuxin src]# rm -fr libiconv-*

    [root@tuxin src]# echo "/usr/local/ lib" >> /etc/ld.so.conf

    [root@tuxin src]# sbin/ldconfig

    -bash: sbin/ldconfig: No such file or directory

    [root@tuxin src]# /sbin/ldconfig

    [root@tuxin src]# tar xjf transmission-*.tar.bz2

    [root@tuxin src]# cd transmission-*

    [root@tuxin transmission-2.33]# ./configure --prefix=/usr

    checking for a BSD-compatible install... /usr/bin/install -c

    checking whether build environment is sane... yes

    checking for a thread-safe mkdir -p... /bin/mkdir -p

    checking for gawk... gawk

    checking whether make sets $(MAKE)... yes

    checking how to create a pax tar archive... gnutar

    checking build system type... x86_64-unknown-linux-gnu

    checking host system type... x86_64-unknown-linux-gnu

    checking for style of include used by make... GNU

    checking for gcc... gcc

    checking whether the C compiler works... yes

    checking for C compiler default output file name... a.out

    checking for suffix of executables...

    checking whether we are cross compiling... no

    checking for suffix of object files... o

    checking whether we are using the GNU C compiler... yes

    checking whether gcc accepts -g... yes

    checking for gcc option to accept ISO C89... none needed

    checking dependency style of gcc... gcc3

    checking for a sed that does not truncate output... /bin/sed

    checking for grep that handles long lines and -e... /bin/grep

    checking for egrep... /bin/grep -E

    checking for fgrep... /bin/grep -F

    checking for ld used by gcc... /usr/bin/ld

    checking if the linker (/usr/bin/ld) is GNU ld... yes

    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B

    checking the name lister (/usr/bin/nm -B) interface... BSD nm

    checking whether ln -s works... yes

    checking the maximum length of command line arguments... 98304

    checking whether the shell understands some XSI constructs... yes

    checking whether the shell understands "+="... yes

    checking for /usr/bin/ld option to reload object files... -r

    checking for objdump... objdump

    checking how to recognize dependent libraries... pass_all

    checking for ar... ar

    checking for strip... strip

    checking for ranlib... ranlib

    checking command to parse /usr/bin/nm -B output from gcc object... ok

    checking how to run the C preprocessor... gcc -E

    checking for ANSI C header files... yes

    checking for sys/types.h... yes

    checking for sys/stat.h... yes

    checking for stdlib.h... yes

    checking for string.h... yes

    checking for memory.h... yes

    checking for strings.h... yes

    checking for inttypes.h... yes

    checking for stdint.h... yes

    checking for unistd.h... yes

    checking for dlfcn.h... yes

    checking for objdir... .libs

    checking if gcc supports -fno-rtti -fno-exceptions... no

    checking for gcc option to produce PIC... -fPIC -DPIC

    checking if gcc PIC flag -fPIC -DPIC works... yes

    checking if gcc static flag -static works... yes

    checking if gcc supports -c -o file.o... yes

    checking if gcc supports -c -o file.o... (cached) yes

    checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes

    checking whether -lc should be explicitly linked in... no

    checking dynamic linker characteristics... GNU/Linux ld.so

    checking how to hardcode library paths into programs... immediate

    checking whether stripping libraries is possible... yes

    checking if libtool supports shared libraries... yes

    checking whether to build shared libraries... yes

    checking whether to build static libraries... yes

    checking for gcc... (cached) gcc

    checking whether we are using the GNU C compiler... (cached) yes

    checking whether gcc accepts -g... (cached) yes

    checking for gcc option to accept ISO C89... (cached) none needed

    checking dependency style of gcc... (cached) gcc3

    checking for g++... g++

    checking whether we are using the GNU C++ compiler... yes

    checking whether g++ accepts -g... yes

    checking dependency style of g++... gcc3

    checking whether we are using the GNU C++ compiler... (cached) yes

    checking whether g++ accepts -g... (cached) yes

    checking dependency style of g++... (cached) gcc3

    checking how to run the C++ preprocessor... g++ -E

    checking for ld used by g++... /usr/bin/ld -m elf_x86_64

    checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes

    checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes

    checking for g++ option to produce PIC... -fPIC -DPIC

    checking if g++ PIC flag -fPIC -DPIC works... yes

    checking if g++ static flag -static works... yes

    checking if g++ supports -c -o file.o... yes

    checking if g++ supports -c -o file.o... (cached) yes

    checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes

    checking dynamic linker characteristics... GNU/Linux ld.so

    checking how to hardcode library paths into programs... immediate

    checking for inline... inline

    checking gcc version... 4.1.2

    checking for ANSI C header files... (cached) yes

    checking whether time.h and sys/time.h may both be included... yes

    checking stdbool.h usability... yes

    checking stdbool.h presence... yes

    checking for stdbool.h... yes

    checking for iconv_open... yes

    checking for pread... yes

    checking for pwrite... yes

    checking for lrintf... no

    checking for strlcpy... no

    checking for daemon... yes

    checking for dirname... yes

    checking for basename... yes

    checking for strcasecmp... yes

    checking for localtime_r... yes

    checking for fallocate64... no

    checking for posix_fallocate... yes

    checking for memmem... yes

    checking for strsep... yes

    checking for strtold... yes

    checking for syslog... yes

    checking for valloc... yes

    checking for getpagesize... yes

    checking for posix_memalign... yes

    checking for statvfs... yes

    checking for htonll... no

    checking for ntohll... no

    checking whether make sets $(MAKE)... (cached) yes

    checking for the pthreads library -lpthreads... no

    checking whether pthreads work without any flags... no

    checking whether pthreads work with -Kthread... no

    checking whether pthreads work with -kthread... no

    checking for the pthreads library -llthread... no

    checking whether pthreads work with -pthread... yes

    checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE

    checking if more special flags are required for pthreads... no

    checking for library containing cos... -lm

    checking for library containing socket... none required

    checking for library containing gethostbyname... none required

    checking for pkg-config... /usr/bin/pkg-config

    checking pkg-config is at least version 0.9.0... yes

    checking for OPENSSL... yes

    checking for LIBCURL... yes

    checking for LIBEVENT... configure: error: Package requirements (libevent >= 2.0.10) were not met:

    No package 'libevent' found

    Consider adjusting the PKG_CONFIG_PATH environment variable if you

    installed software in a non-standard prefix.

    Alternatively, you may set the environment variables LIBEVENT_CFLAGS

    and LIBEVENT_LIBS to avoid the need to call pkg-config.

    See the pkg-config man page for more details.

    [root@tuxin transmission-2.33]#

    [root@tuxin transmission-2.33]# make -s

    make: *** No targets specified and no makefile found. Stop.

    [root@tuxin transmission-2.33]#

    这个怎么弄啊 到这里卡住了 请教

  4. hecking for LIBEVENT… configure: error: Package requirements (libevent >= 2.0.10) were not met:

    No package ‘libevent’ found

    裝個libevent吧 :er

  5. Pingback: Linux Centos系统上安装BT客户端Transmission | 雪糕猪's Blog

  6. :kao 也是久違的更新 XD
    最近火力全開喔XD GY :D

  7. 噗~~ 我要哭了 :kao
    checking for LIBEVENT... configure: error: Package requirements (libevent >= 2.0.10) were not met:

    No package 'libevent' found

    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.

    Alternatively, you may set the environment variables LIBEVENT_CFLAGS
    and LIBEVENT_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.

  8. 呆呆,libevent那摸好用的東西當然要裝啊~ FUCK 下面這PART夾去配 (F)

    cd /usr/src
    wget http://sourceforge.net/projects/levent/files/libevent/libevent-2.0/libevent-2.0.15-stable.tar.gz
    tar zxf libevent-*-stable.tar.gz
    cd libevent-*-stable
    ./configure
    make && make install
    cd ..
    /sbin/ldconfig
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
    rm -rf libevent-*

    :kao 也是久違的更新 XD
    最近火力全開喔XD GY :D

    噗~~ 我要哭了 :kao
    checking for LIBEVENT... configure: error: Package requirements (libevent >= 2.0.10) were not met:

    No package 'libevent' found

  9. :kao 我又不像你是哀踢業的XD
    有得用就好了 :D

  10. collect2: ld returned 1 exit status
    make[1]: *** [blocklist-test] Error 1
    make[1]: Leaving directory `/tmp/transmission-2.42/libtransmission'
    make: *** [all-recursive] Error 1
    [root@houtai transmission-2.42]#

    在make以後出現這樣的錯誤,怎麼辦

  11. 大哥你訊息貼的超長的...幫你縮短 = =...

    檢查一下你的libevent版本吧~ 最常見的問題了。

    在make以後出現這樣的錯誤,怎麼辦

  12. [root@ns1 transmission-2.42]# make -s
    make: *** No targets specified and no makefile found. Stop.
    [root@ns1 transmission-2.42]# tar xjf transmission-*.tar.bz2
    tar: transmission-*.tar.bz2: Cannot open: No such file or directory
    tar: Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error exit delayed from previous errors
    [root@ns1 transmission-2.42]# make -s
    make: *** No targets specified and no makefile found. Stop.
    [root@ns1 transmission-2.42]# make -s install
    make: *** No rule to make target `install'. Stop.
    [root@ns1 transmission-2.42]#

發表迴響

您的電子郵件位址並不會被公開。 必要欄位標記為 *

*

您可以使用這些 HTML 標籤與屬性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>