发新话题
打印

在Ubuntu Libux上安装uTorrent

在Ubuntu Libux上安装uTorrent

This tutorial will be showing you how to install uTorrent in Ubuntu 16.04 LTS and Ubuntu 17.10. It also includes instructions on how to set up a reverse proxy using Nginx/Apache and auto start uTorrent server on Ubuntu.



How to Install uTorrent in Ubuntu 16.04 LTS and Ubuntu 17.10The native uTorrent client for Linux is a web-based application. The latest version was released  for Ubuntu 13.04, but we can still run it in Ubuntu 16.04 LTS and Ubuntu 17.10. Go to uTorrent Linux download page to download the uTorrent server package for Ubuntu 13.04.

Alternatively, you can open up a terminal window and run the following command to download it from the command line.
64 bits


wget http://download.ap.bittorrent.com/track/beta/endpoint/utserver/os/linux-x64-ubuntu-13-04 -O utserver.tar.gz32 bits
wget http://download.ap.bittorrent.com/track/beta/endpoint/utserver/os/linux-i386-ubuntu-13-04 -O utserver.tar.gzOnce downloaded, change working directory to the directory where uTorrent server file is downloaded.  Then run the following command to extract the tar.gz file to /opt/ directory.
sudo tar xvf utserver.tar.gz -C /opt/Next, install required dependencies by executing the following command.
sudo apt install libssl1.0.0 libssl-devThen create a symbolic link.
sudo ln -s /opt/utorrent-server-alpha-v3_3/utserver /usr/bin/utserverUse the following command to start uTorrent server. By default, uTorrent server listens on 0.0.0.0:8080. If there’s another service also listens on port 8080, you should temporarily stop that service. uTorrent will also use port 10000 and 6881.
utserver -settingspath /opt/utorrent-server-alpha-v3_3/ &You can now visit the uTorrent web UI in your browser by entering
your-server-ip:8080/guiIf you are installing uTorrent on your local computer, then replace your-server-ip with localhost.



localhost:8080/guiPlease note that /gui is needed in the URL, otherwise you will encounter invalid request error. When asked for username and password, enter admin in username field and leave password filed empty.

Once you are logged in, you should change the admin password by clicking the gear icon, then selecting Web UI on the left menu. You can change both the username and password, which is more secure than using admin as the username.

If you have other service listening on port 8080, then in the Connectivity section, you can change the uTorrent listening port to other port like 8081.  After changing the port, you must restart uTorrent server with the following commands.
sudo pkill utserverutserver -settingspath /opt/utorrent-server-alpha-v3_3/ &You can set default download directory in the Directories tab.




Setting up Nginx Reverse ProxyTo access your uTorrent server from a remote connection using a domain name, you can set up Nginx reverse proxy.
Sub-directory ConfigurationIf your Ubuntu box already have a website served by Nginx, then you can configure the existing Nginx server block so that you can access uTorrent Web UI from a sub-directory of your domain name.
sudo nano /etc/nginx/conf.d/your-website.confIn the server block,  paste the following directives. If you changed the port before, then you need to change it here too.
location /gui {              proxy_pass http://localhost:8080;              proxy_set_header Host $http_host;              proxy_set_header X-Real-IP $remote_addr;              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;              proxy_set_header X-Forwarded-Proto $scheme;        }Save and close the file. Then test Nginx configuration.
sudo nginx -tIf the test is successful, reload Nginx.
sudo systemctl reload nginxNow you can access uTorrent Web UI via



your-domain.com/guiSub-domain ConfigurationIf you don’t have an existing website on the Ubuntu box, then you have to create a new server block file. Install Nginx on Ubuntu 16.04 or Ubuntu 17.04:
sudo apt install nginxStart Nginx web server.
sudo systemctl start nginxThen create a new server block file in /etc/nginx/conf.d/ directory.
sudo nano /etc/nginx/conf.d/utserver-proxy.confPaste the following text into the file. Replace utorrent.your-domain.com with your preferred sub-domain and don’t forget to create A record for it.
server {       listen 80;       server_name utorrent.your-domain.com;       location /gui {              proxy_pass http://localhost:8080;              proxy_set_header Host $http_host;              proxy_set_header X-Real-IP $remote_addr;              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;              proxy_set_header X-Forwarded-Proto $scheme;        }}Save and close the file. Then test Nginx configuration.
sudo nginx -tIf the test is successful, reload Nginx.
sudo systemctl reload nginxNow you can access uTorrent Web UI via
utorrent.your-domain.com/guiSetting up Apache Reverse ProxyIf you use Apache web server rather than Nginx, then follow the instructions below to set up reverse proxy.


Install Apache web server.
sudo apt install apache2To use Apache as a reverse proxy, we need to enable the proxy modules and we will also enable the rewrite module.
sudo a2enmod proxy proxy_http rewriteThen create a virtual host file for uTorrent.
sudo nano /etc/apache2/sites-available/utorrent.confPut the following configurations into the file. Replace utorrent.your-domain.com with your actual domain name and don’t forget to set an A record for it.
<VirtualHost *:80>    ServerName utorrent.your-domain.com    RewriteEngine on    RewriteRule ^/gui(/?)(.*)$ /$2 [PT]    ProxyPreserveHost on    ProxyPass / http://127.0.0.1:8080/gui/    ProxyPassReverse / http://127.0.0.1:8080/gui/&lt;/VirtualHost>Save and close the file. Then enable this virtual host.
sudo a2ensite utorrent.confRestart Apache for the changes to take effect.
sudo systemctl restart apache2Now you can remotely access uTorrent server by entering the subdomain (utorrent.your-domain.com ) in browser address bar. If uTorrent Web UI doesn’t load, then you may need to delete the default virtual host file and restart Apache web server.
Auto Start uTorrent Server on UbuntuTo enable auto start, we can create a systemd service.
sudo nano /etc/systemd/system/utserver.servicePut the following text into the file.



[Unit]Description=uTorrent ServerAfter=network.target[Service]Type=simpleUser=utorrentGroup=utorrentExecStart=/usr/bin/utserver -settingspath /opt/utorrent-server-alpha-v3_3/ &ExecStop=/usr/bin/pkill utserverRestart=alwaysSyslogIdentifier=uTorrent Server[Install]WantedBy=multi-user.targetSave and close the file. Then reload systemd.
sudo systemctl daemon-reloadNote that it’s recommended not to run uTorrent server as root, so we’ve specified in the service file that uTorrent server should run as the utorrent user and group, which have no root privileges. Create the utorrent system user and group with the following command.
sudo adduser --system utorrentsudo addgroup --system utorrentAdd the utorrent user to the utorrent group.
sudo adduser utorrent utorrentNext, Stop the current uTorrent server.
sudo pkill utserverUse the systemd service to start uTorrent server.
sudo systemctl start utserverEnable auto start at boot time.
sudo systemctl enable utserverNow check utserver status.
systemctl status utserver
We can see that auto start is enabled and uTorrent server is running. When creating the utorrent user, a home directory was also created at /home/utorrent/. It’s recommended that you set this home directory as your torrent download directory because the utorrent user has write permission. We also need to make utorrent as the owner of the /opt/utorrent-server-alpha-v3_3/directory by executing the following command.
sudo chown utorrent:utorrent /opt/utorrent-server-alpha-v3_3/ -RHow to Uninstall uTorrent on UbuntuTo remove uTorrent, first stop the current uTorrent process.
sudo pkill utserverThen remove the installation directory.
sudo rm -r /opt/utorrent-server-alpha-v3_3/And remove the symbolic link.
sudo rm /usr/bin/utserverThat’s it! I hope this tutorial helped you install uTorrent on Ubuntu 16.04 LTS and Ubuntu 17.04. You may also want to check out tutorials on how to install Deluge or qBitTorrent on Ubuntu.

原文: https://www.linuxbabe.com/ubuntu/install-utorrent-ubuntu-16-04-17-04

https://blog.csdn.net/linuxprobe2017/article/details/79453124

CentOS6 64位 下安装 utorrent howto BT
https://www.linuxidc.com/Linux/2013-04/82388.htm

[ 本帖最后由 linda 于 2019-10-14 10:28 编辑 ]

TOP

发新话题