Select Page

Centos / Debian 安装配置Transmission 笔记

Centos / Debian 安装配置Transmission 笔记
前几天朋友给了我一枚M-team的邀请,我也就好奇试着挂一下PT。

aria2虽然也可以挂PT,但还是怕被检测出来封号,为了不连累朋友,所以转战Transmission。

网上多数的教程基本都是互相转载的,有一些是互相矛盾,说白了就是转的人自己没有真的实践过。

折腾了几个小时,想记录一下,也方便以后搜到这篇文章的人。

Centos 7

安装EPEL库
使用root用户登录,运行以下命令:
yum install epel-release
yum -y update
安装与配置
使用root用户登录,运行以下命令:
yum install transmission-daemon

启动Transmission

systemctl start transmission-daemon.service
安装后打开浏览器,登录http://domain:9091或http:// server-ip:9091

然后会发现如下文字

403: Forbidden

Unauthorized IP Address.

Either disable the IP address whitelist or add your address to it.

If you're editing settings.json, see the 'rpc-whitelist' and 'rpc-whitelist-enabled' entries.

If you're still using ACLs, use a whitelist instead. See the transmission-daemon manpage for details.

因为编辑json文件需要停止Transmission的工作状态,不然而会强行写保护改回去,所以先停止Transmission

systemctl stop transmission-daemon.service
配置json文件

vim /var/lib/transmission/.config/transmission-daemon/settings.json

这里我就不全部贴出每一项配置了,感兴趣的请去查阅官方的Documentation,此处我的修改是用来挂PT的仅供参考
#第14行修改为"dht-enabled": false,

#第20行修改为"encryption": 2,

#第49行修改自定义的密码"rpc-password": "mypassword",

#第52行修改成自定义的登录账号名称"rpc-username": "myusername",

#第54行修改为"rpc-whitelist-enabled": false,

启动Transmission
systemctl start transmission-daemon.service
默认的文件下载地址不建议修改,因为需要修改对应的权限和用户,不然会出错,别问我怎么知道的。

OK 至此已经安装成功可以使用了。

打开浏览器输入地址就可以使用 http://yourdomain:9091或http:// server-ip:9091

 

然后我再安利一个远程的管理gui,非常方便,功能多不少。

https://github.com/transmission-remote-gui/transgui

顺便提一下设置里的远程主机填LNMP对应的虚拟主机servername就行了(比如www.aliyun.com)

Debian

安装与配置
使用root用户登录,运行以下命令:

apt-get update
apt-get install transmission-daemon -y

安装后打开浏览器,登录http://domain:9091或http:// server-ip:9091

然后会发现如下文字

403: Forbidden

Unauthorized IP Address.

Either disable the IP address whitelist or add your address to it.

If you're editing settings.json, see the 'rpc-whitelist' and 'rpc-whitelist-enabled' entries.

If you're still using ACLs, use a whitelist instead. See the transmission-daemon manpage for details.

因为编辑json文件需要停止Transmission的工作状态,不然而会强行写保护改回去,所以先停止Transmission

/etc/init.d/transmission-daemon stop

配置json文件,同上

vim /var/lib/transmission-daemon/info/settings.json

如果更改了json文件中的下载地址,需要赋予权限和更改用户组:

mkdir -p /home/wwwroot/pt
chmod -R 755 /home/wwwroot/pt
chown -R debian-transmission /home/wwwroot/pt
chgrp -R debian-transmission /home/wwwroot/pt

启动Transmission

/etc/init.d/transmission-daemon start

OK 至此已经安装成功可以使用了。

打开浏览器输入地址就可以使用 http://yourdomain:9091或http:// server-ip:9091

 

如果要给Transmission加上https防劫持也是可以的,我自己研究了下,分享出我Nginx反代的配置:

server {

listen 80;
server_name yourdomin.com;
return 301 https://$host$request_uri;
}

server {

listen 443;
server_name yourdomin.com;
root /usr/share/transmission/web;
ssl_certificate /usr/local/nginx/conf/vhost/xxx.pem;
ssl_certificate_key /usr/local/nginx/conf/vhost/xxx.key;

ssl on;
ssl_session_cache builtin:1000 shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
ssl_prefer_server_ciphers on;

location / {
proxy_read_timeout 300;
proxy_pass_header X-Transmission-Session-Id;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# if you changed the port number for transmission daemon, then adjust the
# folllowing line
proxy_pass http://127.0.0.1:9091/transmission/web/;
}

# Also Transmission specific
location /rpc {
proxy_pass http://127.0.0.1:9091/transmission/rpc;
}

location /upload {
proxy_pass http://127.0.0.1:9091/transmission/upload;
}
}

About The Author

Jackie Sung

Jackie Sung, also known by his nick-name KK, always strives for the best and learn from the best. Influenced by the age of Internet, for the last few years, in his spare time, he's been working and living as a Freelance Web Engineer/ Web Developer & Designer/ Amateur Photographer/ Husky Lover. The work he provides is of highest quality, fully-customized responsive, and tested in a wide range of devices, which typically covers both front-end (HTML5/ CSS3/ JavaScript) and back-end (WordPress as the CMS) responsibilities.

Leave a reply

电子邮件地址不会被公开。 必填项已用*标注

8 − 5 =

关于本站

主要用于记录和分享我所折腾过的东西
因为业务关系,本站采用双语
我是菜鸡 各位大佬多包含 别DDCC我 谢谢
工作联系 hello#jackiesung.com 将#换成@

订阅本站

Pin It on Pinterest

Share This