- 添加源
yum install epel-release -y
- 关闭防火墙,selinux。
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
cat /etc/selinux/config
- 安装docker和docker-compose
yum install docker docker-compose -y
- 启动docker添加自起
systemctl start docker
systemctl enable docker
- 编写docker-yaml
version: '3'
services:
mysql-db:
container_name: fno_mysql
image: mysql
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: 123456
volumes:
- /usr/local/mysql/conf:/etc/mysql/conf.d
- /usr/local/mysql/logs:/logs
- /usr/local/mysql/data:/var/lib/mysql
app:
container_name: nextcloud
image: nextcloud
restart: always
ports:
- "8080:80"
volumes:
- /root/nextcloud/html:/var/www/html
- /root/nextcloud/apps:/var/www/html/custom_apps
- /root/nextcloud/config:/var/www/html/config
- /root/nextcloud/nextcloud/data:/var/www/html/data
- /root/nextcloud/themes:/var/www/html/themes
app22:
container_name: onlyoffice
image: onlyoffice/documentserver
restart: always
ports:
- "6060:80"
volumes:
- /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice
- /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data
- /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice
- /app/onlyoffice/DocumentServer/db:/var/lib/postgresql
- 启动,授权mysql
docker-compose -f docker-compose.yml up
docker exec -it mysql_id bash
mysql -u root -p
GRANT ALL PRIVILEGES on *.* to root@'%' WITH GRANT OPTION;
ALTER USER 'root'@'%' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
FLUSH PRIVILEGES;
- 查看并访问
docker ps
填写创建的用户密码,和mysql数据库的信息。
下载插件很慢,有2种方式:
1.配置代理
vim /root/nextcloud/config/config.sample.php
2.离线安装
链接:https://apps.nextcloud.com/apps/onlyoffice/releases?platform=22#22
下载之后解压到:
/root/nextcloud/apps
- 点击应用,并启动应用:
- 配置onlyoffice:
vi config/config.php #最后一行添加,否则不能连接成功。
'allow_local_remote_servers' => true,