Files
blog/source/_posts/2025/2025.08/deploy-owncloud-and-onlyoffice.md
2026-02-03 14:40:46 +08:00

46 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
filename: deploy-owncloud-and-onlyoffice
title: 搭建Owncloud并集成Onlyoffice
updated: ''
cover: https://pic.biss.click/image/a990c4b7-3081-4cd0-b632-2de189b299bf.webp
tags: 网站
categories: 技术
abbrlink: 59c8572a
toc: true
comments: true
date: 2025-08-26 14:27:00
---
# 引言
因为正好有云存储的需求恰好又有服务器所以决定自建一个Owncloud网盘服务集成一个Onlyoffice。
# 安装网盘
## 建站
在官网下载最新的安装包
{% link Owncloud,Owncloud,https://owncloud.com/ %}
因为使用1panel所以搭网站很简单选择`php7.3`运行环境,添加必要的`php`扩展,新建一个`Mysql`数据库,按照正常步骤安装就行了。
## 调优
1. 配置Redis缓存
在1panel安装Redis
在config/config.php中添加
```php
'filelocking.enabled' => true,
'memcache.local' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
'host' => '容器名', // For a Unix domain socket, use '/var/run/redis/redis.sock'
'port' => 6379, // Set to 0 when using a Unix socket
'timeout' => 0, // Optional, keep connection open forever
'password' => 'password', // Optional, if not defined no password will be used.
'dbindex' => 0, // Optional, if undefined SELECT will not run and will
// use Redis Server's default DB Index.
],
```
2. 添加Cron任务
首先在Owncloud的配置页面把计划任务调整为`Cron`
在1panel的计划任务中添加容器选择`php7.3`的容器,用户必须为`www-data`时间为每15分钟。
```bash
php sites/cloud.biss.click/index/occ system:cron
```
# 集成Onlyoffice
在1panel应用商店直接安装Onlyoffice并反向代理到自己的域名
在Owncloud中搜索Onlyoffice插件然后填写自己的域名、密钥在参数中可以查到