通过rtinst脚本安装Rtorrent+rutorrent(附版本切换教程)

最新更新:2018/1/14  “简单配置以支持rt文件拖回本地”

 

注意:先说下使用环境,Debian8/9 和 Ubuntu14.04 及以上,其中Debian9仅支持rtorrent0.9.6版本

一、rtinst脚本介绍

Github链接: https://github.com/arakasi72/rtinst

主要功能: 一键安装rtorrent和rutorrent以及配套软件 nginx和irssi

二、安装rtinst脚本

①初始化rtinst安装环境

通过xshell或者putty连接上服务器后,执行以下命令(需要使用root用户登录)

 

bash -c "$(wget --no-check-certificate -qO - https://raw.githubusercontent.com/arakasi72/rtinst/master/rtsetup)"

 

②一键安装

执行以下命令

 

rtinst -t
 

 

 

然后依次输入y,回车,输入用户名,回车,y,回车,输入2次密码,这个是你新建用户的密码,再次输入2次密码,这是webui的密码,怕遗忘,都设置成一样的就可以了,然后就开始安装了,视机器性能,安装时间5-30分钟不等。

 

三、更改nginx和ssh配置文件

①更改nginx配置文件

 

因为安装完成后默认开启了https,这样你打开rt的webui时会提示证书有问题什么的,为了简化流程,取消就可以了,文件位置是/etc/nginx/sites-enabled/default,全部清空,修改为如下

 

server {
        listen 80;
        root /var/www;
        index index.html index.php index.htm;
        client_max_body_size 40m;
        location / {
               try_files $uri $uri/ =404;
        }
        location /rutorrent {
               client_max_body_size 40m;
               auth_basic "Restricted";
               auth_basic_user_file /etc/nginx/.htpasswd;
               include /etc/nginx/conf.d/php;
               include /etc/nginx/conf.d/cache;
        }
        location ~ /\.ht {
                deny all;
        }
}

 

 

 

然后运行命令,/etc/init.d/nginx
restart
  重启nginx,使修改生效。

②修改ssh配置文件

因为安装完rtinst脚本后默认关闭了root登录,所以你需要修改一下ssh的配置文件,否则你会发现你使用root用户连不上服务器了。文件是/etc/ssh/sshd_config

 

修改

PermitRootLogin yes

 

注释掉以下这项

 

#AllowGroups sudo sshuser

然后运行 

 

service ssh restart

 

 

使修改生效,这样以后还是可以使用root用户登录系统。

四、访问webui进行下载

当你完成以上操作后,访问

 

http://盒子IP/rutorrent

用户名和密码就是你在第二步设置的那个。

 

五、常见问题汇总

①更换rt版本

执行以下命令

 

wget  https://raw.githubusercontent.com/arakasi72/rtinst/master/scripts/rtupdate 
bash rtupdate

 

 

 

②修改webui密码

执行以下命令

 

htpasswd –c /etc/nginx/.htpasswd 新用户名

然后回车,依次输入2次新的密码,然后刷新webui,修改完毕。

 

如果没生效,执行 /etc/init.d/nginx restart 重启nginx即可。

③添加RSS自动下载

打开webui,左下角右键所有订阅即可添加rss

 

想要添加的rss自动下载,还需要设置下,如图,打开上方rss设置,在新界面添加一个,名称随意,然后在过滤器中填上/^/,然后点击2次目录右方三个点,自动选择目录,然后确定即可

 

④配置nginx的文件目录功能(支持RT文件拖回本地)

修改nginx的配置文件 /etc/nginx/sites-enabled/default 添加如下内容

 

        location /rtdown {
               auth_basic "Restricted";      #密码提示字段,可任意设置
               auth_basic_user_file /etc/nginx/.htpasswd;  #如果不需要访问密码,删掉此行和上一行即可
               alias /home/pthezi/rtorrent/download;    #这是rt默认存储位置,当然你也可以换成别的的
               autoindex on;
        }

然后运行

 

 

service nginx restart

 

然后访问如下地址,即可访问你通过RT下载好的文件,密码即安装时设置的Rutorrent的访问密码

 

http://盒子IP/rtdown

 

 

有什么问题给我留言吧。

posted @ 2018-03-09 14:26  浪潮之巔  阅读(570)  评论(0编辑  收藏  举报