惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
J
Java Code Geeks
月光博客
月光博客
博客园_首页
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
B
Blog RSS Feed
博客园 - 聂微东
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
量子位
Martin Fowler
Martin Fowler
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗

Jiajun的技术笔记

你好,2026! TiDB 源码阅读(六):TiDB Coprocessor 源码解析 性能优化的核心思想 TiDB 源码阅读(五):索引 TiDB 源码阅读(四):AST、逻辑计划、物理计划 CockroachDB Serverless Architecture podman 无故退出 Cursor Control-L (CTRL-L) Keyboard Shortcuts in Terminal Replace docker with podman Using xmonad with xfce4 A RC script for freebsd frpc 自己动手写一个k8s controller AI 会取代你的(编程)岗位吗? 自建DERP服务器提升Tailscale连接速度(使用Nginx转发) 自动升级Docker容器 再读《程序员修炼之道-从小工到专家》 让浏览器下载文件 再读《软件随想录》/《黑客与画家》/《软技能》 HTTP 压力测试中的 Coordinated Omission 2的补码 编程语言中的 context 是什么? flutter macOS 构建出错 Flatpak 使用小记 Golang CAS 操作是怎么实现的 PostgreSQL 当MQ来使用 Clash 结合 工作VPN 的网络设计 使用 PostgreSQL 搭建 JuiceFS PostgreSQL 配置优化和日志分析 有GitHub Copilot?那就可以搭建你的ChatGPT4服务 窗口函数的使用(以PG为例)
搭建aria2服务器
Jiajun Huang · 2019-04-06 · via Jiajun的技术笔记

首先安装:

$ sudo pacman  -S aria2

然后创建如下systemd配置(放到 /etc/systemd/system/aria2.service):

[Unit]
Description=Aria2 Service
After=network.target

[Service]
User=http
ExecStart=/usr/bin/aria2c --enable-rpc --rpc-listen-all --rpc-allow-origin-all --save-session /etc/aria2/session.lock --input-file /etc/aria2/session.lock --conf-path=/etc/aria2/aria2.conf

[Install]
WantedBy=default.target

创建aria2配置文件:

$ sudo mkdir /etc/aria2
$ sudo touch /etc/aria2/session.lock
$ sudo vim /etc/aria2/aria2.conf

把如下配置贴进去:

continue # 断点续传
dir=/data/download  # 下载路径,注意要配置好写入权限
file-allocation=none  # 是否prealloc,我选择不
log-level=info # 日志等级
max-connection-per-server=4 # 每个服务器4个连接
max-concurrent-downloads=3 # 最多3个并发下载
enable-http-pipelining=true # 是否开启pipelining
rpc-secret=<token> # 这里要换成你自己的token

然后启动aria2:sudo systemctl start aria2

可以装一个前端,我是用的是 aria2-webui

$ cd /data/html
$ git clone [email protected]:ziahamza/webui-aria2.git aria2

Nginx加个配置:

        location /dl {
            alias /data/html/aria2/docs;
            index  index.html index.htm;
        }

        location /jsonrpc {
            proxy_pass http://127.0.0.1:6800;
        }

就可以访问 http://127.0.0.1/dl 来下载文件了,当然,访问到网页之后记得填上面配置文件里的token。