AI 翻譯
這篇文章透過AI由英文翻譯成繁體中文。查看原文
cloudreve PHP 網盤快速搭建
一、去GitHub下載程式版本:https://github.com/cloudreve/Cloudreve/releases
然後在你的伺服器上解壓,在輸入以下命令:
#解壓獲取到的主程式
tar -zxvf 程式名.tar.gz
# 賦予執行權限
chmod +x ./cloudreve
# 啟動 Cloudreve
./cloudreve
Cloudreve 默認會監聽5212端口。你可以在瀏覽器中訪問http://IP:5212進入 Cloudreve。(寶塔記得放行5212端口,並設置好反代可以直接域名訪問)
二、設置開機自啟
# 編輯配置文件
vim /usr/lib/systemd/system/cloudreve.service
注意將下文 PATH_TO_CLOUDREVE 更換為程式所在目錄:
[Unit]
Description=Cloudreve
Documentation=https://docs.cloudreve.org
After=network.target
Wants=network.target
[Service]
WorkingDirectory=/PATH_TO_CLOUDREVE
ExecStart=/PATH_TO_CLOUDREVE/cloudreve
Restart=on-abnormal
RestartSec=5s
KillMode=mixed
StandardOutput=null
StandardError=syslog
[Install]
WantedBy=multi-user.target
配置無誤:wq 保存退出,啟動程式
# 更新配置
systemctl daemon-reload
# 啟動服務
systemctl start cloudreve
# 設置開機啟動
systemctl enable cloudreve
<br>管理命令:<br/>
<br># 啟動服務<br/>
systemctl start cloudreve
# 停止服務
systemctl stop cloudreve
# 重啟服務
systemctl restart cloudreve
# 查看狀態
systemctl status cloudreve