注意:是centos7才能用此方法
Step 1. First, you need to enable EPEL repository on your system.
yum install epel-release
yum -y update
Step 2. Installing Transmission.
Just run the following command to install Transmission:
yum install transmission-cli transmission-common transmission-daemon
Once complete, you can verify Transmission is installed by running the below command:
systemctl start transmission-daemon.service
systemctl stop transmission-daemon.service
Step 3. Configuration Transmission.
Edit the transmission settings.json config file:
yum install nano
nano /var/lib/transmission/.config/transmission-daemon/settings.json
OK now let’s edit the settings (to your liking) and don’t forget to save.
"rpc-authentication-required": true, "rpc-enabled": true, "rpc-password": "mypassword", "rpc-username": "mysuperlogin", "rpc-whitelist-enabled": false, "rpc-whitelist": "0.0.0.0",
nano使用快捷Ctrl+X,然后會提示輸入Y保存修改、輸入N放棄修改,有的linux系統可能還要 回車(Enter) 確認。
After editing and saving the settings.json file, start the transmission daemon:
systemctl start transmission-daemon.service
Step 4. Accessing Transmission.
Transmission BitTorrent Client will be available on HTTP port 9091 by default. Open your favorite browser and navigate to http://yourdomain.com:9091 or http://server-ip:9091. You should be greeted with the Transmission WebUI. After logging in, you will notice that the value for the rpc-password inside the settings.json file will be hashed. If you are using a firewall, please open port 80 to enable access to the control panel.
Step 5.Transmission 自動啟動
1.修改腳本文件rc.local:vim /etc/rc.d/rc.local
這個腳本是使用者自定的開機啟動程序,可以在里面添加想在系統啟動之后執行的腳本或者腳本執行命令
2.添加如下內容:
systemctl start transmission-daemon.service
3.esc 退出編輯,:wq 保存修改
4.將rc.local修改為可執行
chmod 777 /etc/rc.d/rc.local
Step 6.給Transmission下載目錄授權讀寫權限
比如:775 權限
trouble shooting
在客戶端訪問服務端的 9091 端口打不開
檢查 firewalld 是否啟動,需要檢查 tcp 9091 端口是否放行。注意 transmission 需要在一個端口(默認51413)監聽,必須在 firewalld 中放行 tcp、udp 的這個端口。
sudo firewall-cmd --permanent --add-service=transmission-client
,
這個 transmission-client 估計是在安裝 transmission 的時候自動創建的。
檢查本機的 9091 端口是否在 listening ss -lnp | grep 9091
修改下載路徑到 /home/red/transmission
- add red to the transmission group
sudo usermod -a -G transmission red
- change the folder ownership
sudo chgrp -R transmission /home/red/transmission/
- grant write access to the group
sudo chmod -R 770 /home/red/transmission/
- Stop the deamon with
sudo systemctl stop transmission-daemon.service
The last thing to do is change the file creation mask, so that the downloaded files would be writeable by red.
sudo vim /var/lib/transmission/.config/transmission-daemon/settings.json
and change "umask": 18 to "umask": 2.
start tranmission-daemon
sudo sudo systemctl start transmission-daemon.service
修改 setting.json 設置默認下載路徑
修改下面兩個地方 修改配置需要提前 stop transmission-daemon
"download-dir": "/home/red/transmission",
"incomplete-dir": "/home/red/transmission",
如果要卸載transmission,請用命令:
yum erase transmission -y
centos6 安裝transmission
安裝后,啟動transmission,然后再關掉:
service transmission-daemon start
service transmission-daemon stop
另外在CentOS 6上發現就算是修改了配置文件settings.json后啟動transmission還行直接進入界面,根本不需要密碼。
查看配置文件發"rpc-authentication-required": 又變成false,后來研究了好久發現還需要把/etc/init.d/transmission-daemon里面的參數修改一下
vi /etc/init.d/transmission-daemon
把
DAEMON_ARGS="-T --blocklist -g $TRANSMISSION_HOME/.config/transmission"
修改為
DAEMON_ARGS="-t --blocklist -g $TRANSMISSION_HOME/.config/transmission"
另外還要關閉transmission后再去修改settings.json,
service transmission-daemon stop
vi /var/lib/transmission/.config/transmission/settings.json
把 "rpc-authentication-required": false,
修改為:"rpc-authentication-required": true,
啟動 service transmission-daemon start