366 字
2 分钟

同时部署多个Openlist程序

2025-01-05
浏览量 加载中...

前言#

用openlist官方提供的一键脚本可以轻松的让我们将openlist部署到我们的服务器中,但是这种方法只能部署一个openlist程序,如果我们想要部署第二个或者多个openlist程序要怎么做呢?本文就提供一个思路。

1、复制主程序#

创建一个新文件夹,如openlist2,将openlist主程序复制一份到openlist2中;

2、赋权#

cd openlist2,然后授予程序执行权限:chmod +x openlist;

3、初始化#

生成本地配置文件:./openlist admin random,如需自定义密码则:./openlist admin set NEW_PASSWORD;

4、修改端口#

在openlist2/data目录下找到config.json文件并打开,找到scheme下的"http_port": 5244,,将5244改为任意未使用端口并保存(记得安全组或防火墙放行该端口);

5、配置守护进程#

打开/etc/systemd/system目录,创建服务名.service,如opnelist2.service,打开并添加如下内容:

[Unit]
Description=openlist
After=network.target
[Service]
Type=simple
WorkingDirectory=path_openlist
ExecStart=path_openlist/openlist server
Restart=on-failure
[Install]
WantedBy=multi-user.target

将Description=openlist改为Description=opnelist2,path_openlist改为openlist所在路径,如WorkingDirectory=var/openlist2,ExecStart=var/openlist2/openlist server,然后保存。 然后,执行systemctl daemon-reload重载配置

7、启动并配置开机自启#

先执行systemctl start opnelist2启动openlist,再执行systemctl enable opnelist2配置开机启动,即可通过ip:端口访问openlist程序了,和官方一样使用命令控制:

Terminal window
启动: systemctl start opnelist2
关闭: systemctl stop opnelist2
配置开机自启: systemctl enable opnelist2
取消开机自启: systemctl disable opnelist2
状态: systemctl status opnelist2
重启: systemctl restart opnelist2

文章分享

如果这篇文章对你有帮助,欢迎分享给更多人!

同时部署多个Openlist程序
https://blog.zwfpro.com/posts/more-oplist/
作者
赵公子
发布于
2025-01-05
许可协议
CC BY-NC-SA 4.0
最后更新于 2025-01-05,距今已过 654 天

部分内容可能已过时

评论区

Profile Image of the Author
赵公子
所见皆可记,所遇皆有意
公告
欢迎来到岁语集,这里是赵公子的博客,记录技术、生活与思考。
分类
标签
站点统计
文章
14
分类
7
标签
24
总字数
6,151
运行时长
0 天
最后活动
0 天前

目录