Update 'pages/02.deluge/default.md'

This commit is contained in:
Amritanshu Agrawal 2017-03-13 08:04:17 +00:00
parent c797a0a653
commit 2d974ff5da
1 changed files with 47 additions and 27 deletions

View File

@ -1,33 +1,43 @@
# Deluge
### Install
# Deluge (Table of Contents)
* [Install Deluge Daemon and Web UI](#install)
* [Verify Installion](#verify)
* [User Management](#user)
* [Autostart deluged with systemd](#auto)
* [Autostart Web UI with systemd](#webui)
* [Enable Logging](#logging)
* [Enable Log Rotation](#rotation)
* [Finally](#finally)
### Install Deluge Daemon and Web UI <a id="install"></a>
```sh
$ sudo add-apt-repository ppa:deluge-team/ppa
$ sudo apt update
$ sudo apt install deluge deluged deluge-web deluge-webui
```
### Verify Deluge Installion
Ensure Deluge daemon `deluged` and Web UI `deluge-web` are installed.
Use `which deluged` or `which deluge-web` to check installation path. If
they are not installed in the usual `/usr/bin` modify the service
file `ExecStart` lines to point to the correct location (e.g.
`/usr/local/bin/deluged`).
### User Management
### Verify Deluge Installion <a id="verify"></a>
Ensure Deluge daemon `deluged` and Web UI `deluge-web` are installed. Use `which deluged` or `which deluge-web` to check installation path. If they are not installed in the usual `/usr/bin` modify the service file `ExecStart` lines to point to the correct location (e.g. `/usr/local/bin/deluged`).
### User Management <a id="user"></a>
For security it is best to run a service with a specific user and group.
You can create one using the following command:
Add to the `deluge`
group any users you wish to be able to easily manage or access files
downloaded through Deluge, for example:
```sh
sudo adduser --system --gecos "Deluge Service" --disabled-password --group --home /var/lib/deluge deluge
sudo adduser tanshu deluge
```
### Autostart with systemd
Create the file `/etc/systemd/system/deluged.service` containing the
following:
### Autostart deluged with systemd <a id="auto"></a>
Create the file `/etc/systemd/system/deluged.service` containing the following:
```sh
sudo nano /etc/systemd/system/deluged.service
```
```
[Unit]
Description=Deluge Bittorrent Client Daemon
@ -41,26 +51,29 @@ Group=deluge
UMask=007
ExecStart=/usr/bin/deluged -d -l /var/log/deluge/daemon.log -L warning
Restart=on-failure
# Configures the time to wait before service is stopped forcefully.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
```
Enable the
service with:
Enable the service with:
```sh
systemctl enable /etc/systemd/system/deluged.service
systemctl start deluged
systemctl status deluged
```
## Deluge Web UI (deluge-web) Service
### Autostart with systemd
Create the file `/etc/systemd/system/deluge-web.service` containing the
following:
### Autostart Web UI with systemd <a id="webui"></a>
Create the file `/etc/systemd/system/deluge-web.service` containing the following:
```sh
sudo nano /etc/systemd/system/deluge-web.service
```
```
[Unit]
Description=Deluge Bittorrent Client Web Interface
@ -78,26 +91,32 @@ Restart=on-failure
[Install]
WantedBy=multi-user.target
```
Enable the service with:
```
systemctl enable /etc/systemd/system/deluge-web.service
systemctl start deluge-web
systemctl status deluge-web
```
## Logging
Create a log directory for Deluge and give the service user (e.g.
`deluge`), full access:
### Logging <a id="logging"></a>
Create a log directory for Deluge and give the service user (e.g. `deluge`), full access:
```sh
$ sudo mkdir -p /var/log/deluge
$ sudo chown -R deluge:deluge/var/log/deluge
$ sudo chmod -R 750 /var/log/deluge
```
- The deluge log directory is now configured so that user deluge has
full access, group deluge read only and everyone else denied access. The
umask specified in the services sets the permission of new log files.
See Deluge Logging for all available log-levels.
### Log Rotation
- The deluge log directory is now configured so that user deluge has full access, group deluge read only and everyone else denied access. The umask specified in the services sets the permission of new log files.
- See Deluge Logging for all available log-levels.
### Log Rotation <a id="rotation"></a>
To enable log rotation create `/etc/logrotate.d/deluge` with the following code:
```
/var/log/deluge/*.log {
rotate 4
@ -113,5 +132,6 @@ To enable log rotation create `/etc/logrotate.d/deluge` with the following code:
endscript
}
```
### Open Browser
### Open Browser <a id="finally"></a>
`http://localhost:8112`