Last update at :2024-05-18,Edit by888u
Introduction
Due to copyright reasons, many network disks and vps in mainland China do not provide offline download services. However, we can build one ourselves.
Building process
Tool Selection
After some searching, I selected transmission + nginx + aria2c as the deployment tool.
- transmission, transmission-daemon: As a torrent and magnet client, as a core tool for offline downloading.
- nginx: High-performance nginx is used as a static file server.
- aria2c: multi-threaded downloader, download our offline files at high speed from the file list displayed by nginx.
Deployment Practice
1. Install transmission, modify configuration and start service
- Install transmission and transmission-daemon
- Modify the configuration and start the transmission service
The settings.json file under the path /var/lib/transmission/.config/transmission is the transmission configuration file There are a lot of configurations in it. We need to modify the following configurations so that we can use remote software to control our transmission
"rpc-authentication-required": true, "rpc-enabled": true, "rpc-password": "Password for remote calls", "rpc-whitelist-enabled": false, "rpc-username": "Username for remote calls",- Start transmission service
So we can access the transmission service through http://host_ip:9091. We conducted a test and the speed It's still ok, the peak speed is 30MB/s
In addition, we can also install Transmission-Remote-GUI to control transmission without accessing the page. It can be downloaded from the app store under Linux (Mint). The operation method is similar to uTorrent GUI interface:
2. nginx build static file server
Use nginx as a static resource server to provide display of downloaded resources There are a lot of tutorials on the Internet for installing nginx. As follow-up filling.
Let’s talk about configuration
Modify it like this under the nginx configuration file (/etc/nginx/conf.d/default.conf)
autoindex on; autoindex_exact_size on; autoindex_localtime on; server { listen 8090; listen [::]:8090; server_name localhost; charset utf-8; location/{ root /var/lib/transmission/Downloads; index index.html index.htm; }Start the nginx service and you can get the file list through port 8090.
3. aria2c download file
aria2c is used to download files from the server and install them on your own machine.
Mainly talk about how to speed up downloading through aria2c multi-threading
There are several parameters related to multi-threaded downloading in aria2c
- Parameter x: –max-connection-per-server=, the maximum number of connections per server, the default is 1
- Parameter s: –split=, refers to the number of download connections for each file, the default is 5, -s is limited to -x, if s defaults to x greater than 5, x will also be limited to s
So for large files, appropriately increasing the x and s parameters can improve the download speed. In fact, we can install the pagoda panel to solve this nginx problem.
Recommended site search: free com domain name application, domain name registration inquiry, website space registration-free, registration number inquiry, cn domain name, network server, anti-complaint vps host, registered domain name, Hong Kong domain name registration, registered website,
发表评论