扫描二维码关注官方公众号
返回列表 发布新帖

[盒子/seedbox] 【教程】在VPS(Debian)上Transmission的安装记录兼教程

3880 14
发表于 2011-2-22 01:18:30 | 显示全部楼层 阅读模式

来吧兄弟,一起玩一起讨论!

您需要 登录 才可以下载或查看,没有账号?注册

×
本帖最后由 genab 于 2013-6-6 09:34 编辑

1. 前言:
原来都是在Centos上装Transmission挂PT的,这两天在折腾我的VPS,分别试着在Centos和Debian上安装了rtorrent+rutorrent,结果发现rtorrent和transmission相比,并不是很稳定,经常崩溃,虽然可以写脚本定时检查重启,但每次重启都会重新hash文件,问题多多,所以个人以为还是transmission比较合适个人安装使用,之所以rtorrent很多seedbox在用,主要是它比较容易支持多用户,适合多人共享。最终决定还是装回transmission,因为reload的OS是debian,所以也不准备换成centos,于是就有了这篇教程。

2.升级系统
我这里reload的是debian-5.0x86的,不同的版本有可能出现的错误不一样,有问题可以跟贴问,为了方便,我这里都是用root登录安装的
首先升级系统:
  1. apt-get update
  2. apt-get upgrade
复制代码
结果第一条命令就有错误:
  1. GPG error: http://ftp.de.debian.org lenny/updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA
复制代码
你不能忽略这这个,不然下面安装必要库文件的时候会有些库装不上,要解决这个错误,输入下面命令
  1. apt-get install debian-archive-keyring
复制代码
然后重新输入上面两条命令,这次就没有错误了,你需要等几分钟等这个过程结束,这取决于你的VPS

3.安装Transmission
先安装必要的库文件这个可以在transmission的网站找到,所以很简单,直接输入
  1. apt-get install build-essential automake make autoconf libtool pkg-config libcurl4-openssl-dev intltool libxml2-dev libgtk2.0-dev libnotify-dev libglib2.0-dev libevent-dev
复制代码
下载transmission,我这里下的是2.13,并不是最新版,因为最新的版本不在我常去PT的允许客户端列表里,你安装的时候也可以看看你所混的PT的FAQ,然后下载合适的版本,不然被Ban了不要怪我
  1. wget http://download.m0k.org/transmission/files/transmission-2.13.tar.bz2
  2. tar xvjf transmission-2.13.tar.bz2
  3. cd transmission-2.13
  4. ./configure
复制代码
在./configure那一步出现错误:
  1. configure: error: libevent 1.4.9 or higher not found!
复制代码
因此下载安装所需要的libevent版本:
  1. wget http://ftp.us.debian.org/debian/pool/main/libe/libevent/libevent-1.4-2_1.4.13-stable-1_i386.deb
  2. wget http://ftp.us.debian.org/debian/pool/main/libe/libevent/libevent-core-1.4-2_1.4.13-stable-1_i386.deb
  3. wget http://ftp.us.debian.org/debian/pool/main/libe/libevent/libevent-extra-1.4-2_1.4.13-stable-1_i386.deb
  4. wget http://ftp.us.debian.org/debian/pool/main/libe/libevent/libevent-dev_1.4.13-stable-1_i386.deb
  5. dpkg -i *.deb
复制代码
然后继续
  1. ./configure
  2. make
  3. make install
复制代码
到此transmission算是初步装完了

评论14

trott@2楼主Lv.3 发表于 2011-2-22 02:04:28 | 显示全部楼层
本帖最后由 trott 于 2011-2-22 02:07 编辑

4.安装Transmission的启动,停止脚本
脚本在transmission网站有现成的,为了方便起见,我还是把它放在这里

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          transmission-daemon
  4. # Required-Start:    networking
  5. # Required-Stop:     networking
  6. # Default-Start:     2 3 5
  7. # Default-Stop:      0 1 6
  8. # Short-Description: Start the transmission BitTorrent daemon client.
  9. ### END INIT INFO

  10. # Original Author: Lennart A. JÃŒtte, based on Rob Howell's script
  11. # Modified by Maarten Van Coile & others (on IRC)

  12. # Do NOT "set -e"

  13. #
  14. # ----- CONFIGURATION -----
  15. #
  16. # For the default location Transmission uses, visit:
  17. # http://trac.transmissionbt.com/wiki/ConfigFiles
  18. # For a guide on how set the preferences, visit:
  19. # http://trac.transmissionbt.com/wiki/EditConfigFiles
  20. # For the available environement variables, visit:
  21. # http://trac.transmissionbt.com/wiki/EnvironmentVariables
  22. #
  23. # The name of the user that should run Transmission.
  24. # It's RECOMENDED to run Transmission in it's own user,
  25. # by default, this is set to 'transmission'.
  26. # For the sake of security you shouldn't set a password
  27. # on this user
  28. USERNAME=transmission


  29. # ----- *ADVANCED* CONFIGURATION -----
  30. # Only change these options if you know what you are doing!
  31. #
  32. # The folder where Transmission stores the config & web files.
  33. # ONLY change this you have it at a non-default location
  34. #TRANSMISSION_HOME="/var/config/transmission-daemon"
  35. #TRANSMISSION_WEB_HOME="/usr/share/transmission/web"
  36. #
  37. # The arguments passed on to transmission-daemon.
  38. # ONLY change this you need to, otherwise use the
  39. # settings file as per above.
  40. #TRANSMISSION_ARGS=""


  41. # ----- END OF CONFIGURATION -----
  42. #
  43. # PATH should only include /usr/* if it runs after the mountnfs.sh script.
  44. PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  45. DESC="bittorrent client"
  46. NAME=transmission-daemon
  47. DAEMON=$(which $NAME)
  48. PIDFILE=/var/run/$NAME.pid
  49. SCRIPTNAME=/etc/init.d/$NAME

  50. # Exit if the package is not installed
  51. [ -x "$DAEMON" ] || exit 0

  52. # Read configuration variable file if it is present
  53. [ -r /etc/default/$NAME ] && . /etc/default/$NAME

  54. # Load the VERBOSE setting and other rcS variables
  55. [ -f /etc/default/rcS ] && . /etc/default/rcS

  56. #
  57. # Function that starts the daemon/service
  58. #

  59. do_start()
  60. {
  61.     # Export the configuration/web directory, if set
  62.     if [ -n "$TRANSMISSION_HOME" ]; then
  63.           export TRANSMISSION_HOME
  64.     fi
  65.     if [ -n "$TRANSMISSION_WEB_HOME" ]; then
  66.           export TRANSMISSION_WEB_HOME
  67.     fi

  68.     # Return
  69.     #   0 if daemon has been started
  70.     #   1 if daemon was already running
  71.     #   2 if daemon could not be started
  72.     start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \
  73.             --exec $DAEMON --background --test -- -f $TRANSMISSION_ARGS > /dev/null \
  74.             || return 1
  75.     start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \
  76.             --exec $DAEMON --background -- -f $TRANSMISSION_ARGS \
  77.             || return 2
  78. }

  79. #
  80. # Function that stops the daemon/service
  81. #
  82. do_stop()
  83. {
  84.         # Return
  85.         #   0 if daemon has been stopped
  86.         #   1 if daemon was already stopped
  87.         #   2 if daemon could not be stopped
  88.         #   other if a failure occurred
  89.         start-stop-daemon --stop --quiet --retry=TERM/10/KILL/5 --pidfile $PIDFILE --name $NAME
  90.         RETVAL="$?"
  91.         [ "$RETVAL" = 2 ] && return 2

  92.         # Wait for children to finish too if this is a daemon that forks
  93.         # and if the daemon is only ever run from this initscript.
  94.         # If the above conditions are not satisfied then add some other code
  95.         # that waits for the process to drop all resources that could be
  96.         # needed by services started subsequently.  A last resort is to
  97.         # sleep for some time.

  98.         start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
  99.         [ "$?" = 2 ] && return 2

  100.         # Many daemons don't delete their pidfiles when they exit.
  101.         rm -f $PIDFILE

  102.         return "$RETVAL"
  103. }

  104. case "$1" in
  105.   start)
  106.         echo "Starting $DESC" "$NAME..."
  107.         do_start
  108.         case "$?" in
  109.                 0|1) echo "   Starting $DESC $NAME succeeded" ;;
  110.                 *)   echo "   Starting $DESC $NAME failed" ;;
  111.         esac
  112.         ;;
  113.   stop)
  114.         echo "Stopping $DESC $NAME..."
  115.         do_stop
  116.         case "$?" in
  117.                 0|1) echo "   Stopping $DESC $NAME succeeded" ;;
  118.                 *)   echo "   Stopping $DESC $NAME failed" ;;
  119.         esac
  120.         ;;
  121.   restart|force-reload)
  122.         #
  123.         # If the "reload" option is implemented then remove the
  124.         # 'force-reload' alias
  125.         #
  126.         echo "Restarting $DESC $NAME..."
  127.         do_stop
  128.         case "$?" in
  129.           0|1)
  130.                 do_start
  131.                 case "$?" in
  132.                     0|1) echo "   Restarting $DESC $NAME succeeded" ;;
  133.                     *)   echo "   Restarting $DESC $NAME failed: couldn't start $NAME" ;;
  134.                 esac
  135.                 ;;
  136.           *)
  137.                 echo "   Restarting $DESC $NAME failed: couldn't stop $NAME" ;;
  138.         esac
  139.         ;;
  140.   *)
  141.         echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
  142.         exit 3
  143.         ;;
  144. esac
复制代码


这个脚本文件需要作为transmission-daemon放在/etc/init.d/下面,输入以下命令:
  1. vi /etc/init.d/transmission-daemon
复制代码

按i,然后把上面这个脚本粘帖进去,按ESC,然后按冒号:,输入wq,按回车,文件就建立好了

接下来更改文件的权限并使它在启动的时候可以自动执行:
  1. chmod +x /etc/init.d/transmission-daemon
  2. chown root:root /etc/init.d/transmission-daemon
  3. update-rc.d transmission-daemon defaults
复制代码


下来新建一个用户运行transmission,这里用的用户名是transmission,当然你也可以用其他的,不过记得要更改脚本了的USERNAME与之对应
  1. useradd -mr transmission
  2. chmod g+rwx /home/transmission/
复制代码


建立transmission的下载目录并设定权限:
  1. mkdir -p /home/transmission/Downloads/
  2. chown -R transmission.transmission /home/transmission/Downloads/
  3. chmod g+w /home/transmission/Downloads/
复制代码


接下来就可以启动transmission了:
  1. /etc/init.d/transmission-daemon start
复制代码


transmission启动后就自动会在/home/transmission/.config/transmission-daemon下生成settings.json文件,不过在你更改设置之前必须先停止transmission:
  1. /etc/init.d/transmission-daemon stop
复制代码


这样你就可以开始更改设置了:
  1. vi /home/transmission/.config/transmission-daemon/settings.json
复制代码

按i以后就可以开始编辑了,至于参数什么意思请参考transmission的网站,改完后按ESC, 按冒号:,输入wq回车存盘
为了方便你在家里的电脑上用Transmission Remote GUI的连上去管理,下面的设置你必须更改:
  1. "rpc-whitelist-enabled": false - 默认是true,要改为false
  2. “rpc-password": "密码",
  3. "rpc-username": "用户名",
  4. 上面的密码和用户名你可以自己指定
复制代码


从新启动transmission,新的设置就会生效:
  1. /etc/init.d/transmission-daemon start
复制代码


现在你可以下载并安装Transmission Remote GUI,在GUI的options输入VPS的IP地址,rpc的端口(默认是9091,你可以在settings.json中改成其他的),你的用户名和密码,就可以连到你VPS上的transmission了
Transmission Remote GUI的下载地址:
  1. http://transmisson-remote-gui.googlecode.com/files/transgui-2.2-setup.exe
复制代码

另外如果你用Android的手机,可以在菜市场搜索安装Transdroid,它可以很方便的在手机上管理transmission,也可以在手机上下载torrent,通过它传到vps的transmission里进行下载,非常方便

至此transmission在debian的安装就告一段落了,下来有时间我会写一下如何通过rss和irc自动下载torrent并传给transmission进行下载
回复 点赞

使用道具 举报

路人乙Lv.5 发表于 2011-2-22 08:41:38 | 显示全部楼层
mark~收藏备用{:2_115:}
回复 点赞

使用道具 举报

plusoneLv.5 发表于 2011-2-22 08:59:08 | 显示全部楼层
这个正是需要的,最近准备搞个vps玩,希望LZ给推荐个适用于LZ这篇教程又经济实惠的VPS,先谢过了
回复 点赞

使用道具 举报

trott@2楼主Lv.3 发表于 2011-2-22 09:31:40 | 显示全部楼层
buyvm(http://www.buyvm.net/)的5.95刀每月的那款很超值,50G硬盘,2T的流量,随便玩玩足够了,这家并不禁止P2P,我还开ticket问过可不可以,他们就回了两个词have fun :),这家的VPS还支持架设PPTP的VPN,你知道的,有时还是有用的
回复 点赞

使用道具 举报

plusoneLv.5 发表于 2011-2-22 10:15:07 | 显示全部楼层
嗯,看了下,确实不错,可惜buyvm第三款配置缺货:(,我又随便点了点其他几款,全部缺货,不知道是我的操作问题,还是怎么..
回复 点赞

使用道具 举报

相关组织Lv.7 发表于 2011-2-22 11:12:39 | 显示全部楼层
我觉得这样的教程帖子应该设权限...大家都去X 就都没得X了
回复 点赞

使用道具 举报

ayabrea888Lv.5 发表于 2011-2-22 12:02:37 | 显示全部楼层
学历 小收藏下 谢谢楼主分享
回复 点赞

使用道具 举报

woaixiaomai@2Lv.8 发表于 2011-2-22 12:58:24 | 显示全部楼层
呵呵,设个权限吧。收藏啦~~~
回复 点赞

使用道具 举报

hothduserLv.6 发表于 2011-2-22 13:11:41 | 显示全部楼层
不要啊,这种推荐不能说出来啊,要不然大家都跑去挂pt,buyvm就悲剧了。。。。。
回复 点赞

使用道具 举报

cloudcap@2Lv.2 发表于 2011-2-22 15:26:48 | 显示全部楼层
Transmission很好用,正在用
回复 点赞

使用道具 举报

gaodi0107@2Lv.5 发表于 2011-3-31 18:19:29 | 显示全部楼层
楼主的教程很实用啊!
回复 点赞

使用道具 举报

zhangweiboLv.5 发表于 2011-4-9 05:28:35 | 显示全部楼层
debian6好像默认就2.03
Ubuntu10.0.4 默认是1.93

我觉得这2个版本都挺稳定的

楼主的环境是debian5吧,我一般装1.93
回复 点赞

使用道具 举报

huangyuan198882Lv.4 发表于 2011-4-28 22:31:32 | 显示全部楼层
收藏。感谢楼主高人!
回复 点赞

使用道具 举报

rafaelLv.8 发表于 2011-6-4 11:03:00 | 显示全部楼层
本帖最后由 rafael 于 2011-6-4 11:06 编辑

LZ,,这个找不到命令啊...求解.../etc/init.d/transmission-daemon start
进入/etc/init.d/目录再运行也不行啊.  详情 回复
发表于 2011-6-4 11:49
回复 点赞

使用道具 举报

回复

懒得打字嘛,点击右侧快捷回复 【本站酷狼4T,750元】
您需要登录后才可以回帖 登录 | 注册

本版积分规则

投诉/建议联系

support@gebi1.cn

未经授权禁止转载,复制和建立镜像,
如有违反,追究法律责任
  • 关注公众号
  • 添加微信客服
Copyright © 2001-2024 隔壁网 版权所有 All Rights Reserved. 粤ICP备14056481号-1
关灯 在本版发帖
扫一扫添加微信客服
返回顶部
快速回复 返回顶部 返回列表