PT资源需要用uTorrent来下载,而原来uTorrent只有windows版本。我的NAS下载机安装的是linux系统,没有相应版本 的uTorrent可以使用,让人比较纠结。网上也有介绍使用wine在linux下运行windows版的uTorrent,总之不是太爽。原生的 linux版uTorrent终于在2010年9月发布,到现在3个多月过去了,虽然还是Alpha版而非正式版,应该也比较成熟了,因此决定尝试安装使 用。

一、安装环境

先说说我的NAS机器,这个东东的DIY过程已经在本版发帖做过介绍。主要是用ATOM330CPU的离子主板配的下载机。操作系统是ubuntu9.10server版,装了mldonkey下载资源,装了XBMC来播放。

二、uTorrent安装

到uTorrent的主页下载最新的linux版压缩包:http://www.utorrent.com/downloads/linux

我下载回来的uTorrent Server alpha (3.0 build 23418)文件是utorrent-server-3.0-23418.tar.gz

在linux系统中解压:

tar zxvf utorrent-server-3.0-23418.tar.gz

解压出一个目录utorrent-server-v3_0可以看到目录结构:

utorrent-server-v3_0 ---+--- docs (文档资料目录)

+--- utserver(主程序)

+--- webui.zip(web界面系统)

这个东西说起来也简单,直接运行utserver就行,当然,运行前还得创建一个配置文件utserver.conf,最好还是编写一个脚本来方便地启动和停止utserver服务。uTorrent的linux版还不是正式版本,安装工作自己还得多动点手。

(一)初级班

对于入门级用户,首先能用起来可能就满足了。适合这个简单的初级班教程。

1. 用wget命令下载安装包

wget http://download.utorrent.com/linux/utorrent-server-3.0-23418.tar.gz

(注意:具体安装包文件名可能会变化)

2. 用ls命令看看是否成功下载

ls

3. 如果下载成功,就用tar命令解压安装包

tar zxvf utorrent-server-3.0-23418.tar.gz

(如前所述,压缩包文件名也许与我这个不同)

4. 进入解压出来的目录

ls

cd utorrent-server-v3_0

5. 运行uTorrent Server的主程序

./utserver

6. 在浏览器中连接uTorrent Server的web控制页面,默认登录用户admin,密码为空

http://localhost:8080/gui/

(这里是从本机访问,当然也可以从其它电脑访问,把localhost改成uTorrent Server所在电脑IP就可)

复制代码

初级班课程到此结束。

(二)高级班

作为高级班的同学,咱们当然得仔细研究下布局了。我考虑照通常软件安装的目录来办,执行主程序放到/usr/bin目录,配置文件、运行记录log文件等都放到/var/lib/utorrent目录,主要文件分布如下:

/usr/bin/utserver(主程序)

/etc/init.d/utserver(启动脚本)

/var/lib/utorrent/utserver.conf(配置文件)

/var/lib/utorrent/utserver.log(运行记录)

/var/lib/utorrent/webui.zip(web界面文件)

复制代码

而且为了方便自己管理下载回来的资源,决定让utserver进程以我的个人用户权限运行,对我来说就是用户为taxigps,组也为taxigps。当然你也可以专门为运行utorrent创建一个用户。创建用户的问题在这里就不细表了。

1. 咱们先创建utserver的工作目录

sudo mkdir /var/lib/utorrent

sudo chown taxigps /var/lib/utorrent

sudo chgrp taxigps /var/lib/utorrent

sudo mkdir /var/run/utserver

sudo chown taxigps /var/run/utserver

sudo chgrp taxigps /var/run/utserver

(这里的用户名和组名可别抄我的)

2. 把相关文件拷贝到指定目录

sudo cp utserver /usr/bin

cp webui.zip /var/lib/utorrent

复制代码

下面一项重要工作就是创建启动脚本了,用这个命令:

sudo nano /etc/init.d/utserver

复制代码

脚本内容如下:

#! /bin/sh

### BEGIN INIT INFO

# Provides: utserver

# Required-Start: $local_fs $remote_fs $network

# Required-Stop: $local_fs $remote_fs $network

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: Start or stop the utserver.

# Description: uTorrent Server for Linux. A headless

# bittorrent client with a WebUI.

### END INIT INFO

# Author: John Doe john.doe@jd.com

# Please remove the "Author" lines above and replace them

# with your own name f you copy and modify this script.

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script

PATH=/sbin:/usr/sbin:/bin:/usr/bin

DESC="uTorrent Server for Linux"

CHDIR=/usr/bin

NAME=utserver

UT_CONFIG=/var/lib/utorrent/$NAME.conf

UT_SETTINGS=/var/lib/utorrent/

UT_LOG=/var/lib/utorrent/$NAME.log

#DAEMON_ARGS="-daemon -configfile ${UT_CONFIG} -settingspath ${UT_SETTINGS} -logfile ${UT_LOG}"

DAEMON_ARGS="-configfile ${UT_CONFIG} -settingspath ${UT_SETTINGS} -logfile ${UT_LOG}"

DAEMON=$CHDIR/$NAME

USER=taxigps

GROUP=taxigps

PIDFILE=/var/run/$NAME/$NAME.pid

SCRIPTNAME=/etc/init.d/$NAME

STOP_TIMEOUT=5

INIT_VERBOSE=yes

# Exit if the package is not installed

[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present

[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables

. /lib/init/vars.sh

# Define LSB log_* functions.

# ##!u

. /lib/lsb/init-functions

# Function that starts the daemon/service

do_start()

{

# Return

# 0 if daemon has been started

# 1 if daemon was already running

# 2 if daemon could not be started

start-stop-daemon --start --quiet --make-pidfile --pidfile $PIDFILE --chuid $USER:$GROUP --chdir $CHDIR --background --exec $DAEMON --test > /dev/null \

|| return 1

start-stop-daemon --start --quiet --make-pidfile --pidfile $PIDFILE --chuid $USER:$GROUP --chdir $CHDIR --background --exec $DAEMON -- \

$DAEMON_ARGS \

|| return 2

# Add code here, if necessary, that waits for the process to be ready

# to hand./le requests from services started subsequently which depend

# on this one. As a last resort, sleep for some time.

}

# Function that stops the daemon/service

do_stop()

{

# Return

# 0 if daemon has been stopped

# 1 if daemon was already stopped

# 2 if daemon could not be stopped

# other if a failure occurred

start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME

RETVAL="$?"

[ "$RETVAL" = 2 ] && return 2

# Wait for children to finish too if this is a daemon that forks

# and if the daemon is only ever run from this initscript.

# If the above conditions are not satisfied then add some other code

# that waits for the process to drop all resources that could be

# needed by services started subsequently. A last resort is to

# sleep for some time.

start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON

[ "$?" = 2 ] && return 2

# Many daemons don't delete their pidfiles when they exit.

rm -f $PIDFILE

return "$RETVAL"

}

# Function that sends a SIGHUP to the daemon/service

do_reload() {

# If the daemon can reload its configuration without

# restarting (for example, when it is sent a SIGHUP),

# then implement that here.

start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME

return 0

}

case "$1" in

start)

[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"

do_start

case "$?" in

0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;

2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;

esac

;;

stop)

[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"

do_stop

case "$?" in

0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;

2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;

esac

;;

status)

status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?

;;

#reload|force-reload)

# If do_reload() is not implemented then leave this commented out

# and leave 'force-reload' as an alias for 'restart'.

#log_daemon_msg "Reloading $DESC" "$NAME"

#do_reload

#log_end_msg $?

#;;

restart|force-reload)

# If the "reload" option is implemented then remove the

# 'force-reload' alias

log_daemon_msg "Restarting $DESC" "$NAME"

do_stop

case "$?" in

0|1)

do_start

case "$?" in

0) log_end_msg 0 ;;

log_end_msg 1 ;; # Old process is still running

*) log_end_msg 1 ;; # Failed to start

esac

;;

*)

# Failed to stop

log_end_msg 1

;;

esac

;;

*)

#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2

echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2

exit 3

;;

esac

:

复制代码

脚本中这几行代码请根据你自己的情况修改:

CHDIR=/usr/bin

UT_CONFIG=/var/lib/utorrent/$NAME.conf

UT_SETTINGS=/var/lib/utorrent/

UT_LOG=/var/lib/utorrent/$NAME.log

USER=taxigps

GROUP=taxigps

PIDFILE=/var/run/$NAME/$NAME.pid

复制代码

启动脚本创建完成后还要设置成可执行代码:

sudo chmod a+x /etc/init.d/utserver

复制代码

现在你可以用脚本命令来启动和停止utorrent服务了:

/etc/init.d/utserver start(启动utorrent)

/etc/init.d/utserver stop(停止utorrent)

复制代码

现在用起来更方便了吧。

(三)尖子班

尖子班的同学还有更高的追求,比如我就想把720P的电影和1080P的电影下载存放到不同的目录。让我们先建两个目录吧:

mkdir /mnt/data/utorrent

mkdir /mnt/data/share/电影/720P

mkdir /mnt/data/share/电影/1080P

复制代码

注 意,你工作目录,存放下载过程中的临时文件,下载完成 后再移动到完成目录,要保证临时目录和完成目录在同一硬盘,避免大量的文件拷贝。

下一个重要步骤就是编辑utorrent的配置文件了,还是用nano命令:

nano /var/lib/utorrent/utserver.conf

复制代码

参考配置文件内容如下:

# web界面端口号

ut_webui_port:8080

# token认证

token_auth_enable:1

# 保存正在下载项目的临时文件目录

dir_active:/mnt/data/utorrent

# 保存完成下载项目的默认目录

dir_completed:/mnt/data/share/电影/720P

# 保存完成下载项目的可选目录(可以是多个)

dir_download:/mnt/data/share/电影/720P

dir_download:/mnt/data/share/电影/1080P

# web界面登录用户名

admin_name:admin

# web界面登录密码

admin_password:test

复制代码

最后,要在web界面使用分目录存放下载文件功能,你需要下载最新的webui界面系统。到此下载:http://forum.utorrent.com/viewtopic.php?id=58156

Linux解压torrent文件命令,linux版uTorrent安装手记相关推荐

  1. linux的解压zip文件,linux解压zip文件命令是什么

    linux解压zip文件命令是什么 发布时间:2020-04-23 11:02:45 来源:亿速云 阅读:162 作者:小新 今天小编给大家分享的是linux解压zip文件命令是什么,相信很多人都不太 ...

  2. linux解压7z包命令,Linux下解压:tar、rar、7z命令简单易懂的教程(含实例)

    Linux下的解压于压缩确实有点小复杂神马7z啊,gz2啊,bz2啊,rar Linux下的解压于压缩确实有点小复杂神马7z啊,gz2啊,bz2啊,rar啊--不过看完此文,你就不会觉得复杂了.嘻嘻~ ...

  3. linux解压mysql文件命令行_linux mysql命令

    1.linux下启动mysql的命令: mysqladmin start /ect/init.d/mysql start (前面为mysql的安装路径) 2.linux下重启mysql的命令: mys ...

  4. linux解压zip文件命令

    安装unzip命令 yum install unzip 1 解压 unzip keepalived-1.3.4.zip

  5. linux解压rar文件权限,linux下使用unrar命令解压*.rar格式文件

    使用帮助 [user@localhost ~]$ unrar UNRAR 5.40 freeware      Copyright (c) 1993-2016 Alexander Roshal Usa ...

  6. linux解压gz文件的命令

    解压tar.gz文件的命令? LINUX解压缩TAR.GZ文件命令 1.解压缩命令格式: tar -zxvf 压缩文件名.tar.gz 解压缩后的文件只能放在当前的目录. 2.压缩命令格式: tar ...

  7. linux 下gz文件解压命令,Linux解压gz文件的命令怎么写

    Linux解压gz文件的命令怎么写 发布时间:2020-11-17 13:39:53 来源:亿速云 阅读:122 作者:小新 小编给大家分享一下Linux解压gz文件的命令怎么写,相信大部分人都还不怎 ...

  8. linux中gz文件怎么解压,Linux解压gz文件的命令使用教程及详解

    今天小编给带来一篇linux解压方面的资料 Linux解压gz文件的命令有:gunzip命令.gzip命令.tar命令.下面本篇文章就来带大家了解一下 gz文件是一种压缩文件,以.gz或者.tar.g ...

  9. linux php gz,Linux解压gz文件的命令是什么

    Linux解压gz文件的命令有:gunzip命令.gzip命令.tar命令.下面本篇文章就来带大家了解一下,希望对大家有所帮助.[视频教程推荐:Linux教程] gz文件是一种压缩文件,以.gz或者. ...

最新文章

  1. R语言sink函数保存文件实战
  2. Windows Phone本地数据库(SQLCE):5、[Association]attribute(翻译)(转)
  3. 利用openssh实现chroot监牢
  4. Android之Butterknife原理解析
  5. Python 学习笔记12 类 - 使用类和实例
  6. VC6.0: fatal error C1010: unexpected end of file while looking for precompiled head
  7. MFC中char*,string和CString之间的转换
  8. 个人支付宝收款页面,对接当面付接口
  9. HTML表格基础学习
  10. Linux shell脚本详解及实战(五)——shell脚本函数
  11. C# visual studio添加NewtonsoftJSON库
  12. 中标麒麟linux系统微信安装,Linux安装wine微信安装和遇到的问题及解决方法
  13. 华胜天成以精益服务为中国联通构建电子渠道容灾系统
  14. docker-redis配置文件修改
  15. FSSR : Frequency Separation for Real-World Super-Resolution
  16. saas系统和传统服务器的区别,传统CRM与SaaS模式的区别
  17. Zigbee疑难问题定位以及思路方法分享 (一)
  18. telnet远程管理的命令
  19. 二 SQL SELECT
  20. 如何基于虚拟化和SDN实现虚拟化的蜜网

热门文章

  1. access数据库剔除重复项_access排重工具-Access数据库重复记录删除器下载V1.04免费注册版-西西软件下载...
  2. 网络安全证书合集系列
  3. Python NLTK 自然语言处理入门与例程
  4. 毕设进程-小程序云开发随笔
  5. Aria2任意文件写入漏洞 漏洞复现
  6. 网页设计 LOGO 标准尺寸
  7. C语言数据类型、变量、常量、作用域和生命周期的概念解释和案例
  8. Nginx配置从域名A跳转到域名B
  9. 解决Mac电脑显示的系统时间不准确的方法
  10. Mysql基础面试题及查询联系