赞
踩
目录
下面版本为安装时的版本,进行安装时默认会拉取最新的版本进行安装,也可指定具体版本进行安装。
docker version 24.0.2
mysql:8.0.29
onlyoffice/documentserver:8.0.1 ---ubuntu 22.04
onlyoffice/communityserver:12.6.0.1900 ---ubuntu 22.04
onlyoffice/controlpanel:3.5.2.530 ---ubuntu 22.04
onlyoffice/mailserver:1.6.74 ---CentOS
社区版最多可支持 20 个同时连接
docker安装
官方安装说明入口:
使用 bridge 驱动程序创建一个名为 onlyoffice 的新 Docker 网络,创建了这个网络后,你可以在其他 Docker 命令中使用这个网络。
docker network create --driver bridge onlyoffice
mysql数据库目录
- mkdir -p /opt/onlyoffice/mysql/conf.d
- mkdir -p /opt/onlyoffice/mysql/data
- mkdir -p /opt/onlyoffice/mysql/initdb
mysql配置文件
- cd /opt/onlyoffice/mysql/conf.d
- touch onlyoffice.cnf
-
- echo "[mysqld]
- sql_mode = 'NO_ENGINE_SUBSTITUTION'
- max_connections = 1000
- max_allowed_packet = 1048576000
- group_concat_max_len = 2048" > /opt/onlyoffice/mysql/conf.d/onlyoffice.cnf
数据库初始化(注意修改数据库用户的密码)
- cd /opt/onlyoffice/mysql/initdb
- touch setup.sql
-
- echo "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
- CREATE USER IF NOT EXISTS 'onlyoffice_user'@'%' IDENTIFIED WITH mysql_native_password BY 'onlyoffice_password';
- CREATE USER IF NOT EXISTS 'mail_admin'@'%' IDENTIFIED WITH mysql_native_password BY 'mail_password';
- GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
- GRANT ALL PRIVILEGES ON *.* TO 'onlyoffice_user'@'%';
- GRANT ALL PRIVILEGES ON *.* TO 'mail_admin'@'%';
- FLUSH PRIVILEGES;" > /opt/onlyoffice/mysql/initdb/setup.sql
创建MYSQL容器
- sudo docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-mysql-server \
- -v /opt/onlyoffice/mysql/conf.d:/etc/mysql/conf.d \
- -v /opt/onlyoffice/mysql/data:/var/lib/mysql \
- -v /opt/onlyoffice/mysql/initdb:/docker-entrypoint-initdb.d \
- -e MYSQL_ROOT_PASSWORD=password \
- -e MYSQL_DATABASE=onlyoffice \
- mysql:8.0.29
目录
- mkdir -p /opt/onlyoffice/DocumentServer/logs
- mkdir -p /opt/onlyoffice/DocumentServer/data
- mkdir -p /opt/onlyoffice/DocumentServer/fonts
- mkdir -p /opt/onlyoffice/DocumentServer/forgotten
创建documentserver容器
- docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-document-server \
- -v /opt/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
- -v /opt/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
- -v /opt/onlyoffice/DocumentServer/fonts:/usr/share/fonts/truetype/custom \
- -v /opt/onlyoffice/DocumentServer/forgotten:/var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten \
- -e JWT_ENABLED=false \
- onlyoffice/documentserver
Control Panel 提供了丰富的功能用来快速配置和管理 Workspace,包括 LDAP 和 SSO 配置、HTTPS 配置、查看登陆日志和用户操作日志等功能
目录
- mkdir -p /opt/onlyoffice/CommunityServer/data
- mkdir -p /opt/onlyoffice/ControlPanel/data
- mkdir -p /opt/onlyoffice/ControlPanel/logs
创建controlpanel容器
- docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-control-panel \
- -v /var/run/docker.sock:/var/run/docker.sock \
- -v /opt/onlyoffice/CommunityServer/data:/app/onlyoffice/CommunityServer/data \
- -v /opt/onlyoffice/ControlPanel/data:/var/www/onlyoffice/Data \
- -v /opt/onlyoffice/ControlPanel/logs:/var/log/onlyoffice \
- onlyoffice/controlpanel
目录
- mkdir -p /opt/onlyoffice/MailServer/data
- mkdir -p /opt/onlyoffice/MailServer/data/certs
- mkdir -p /opt/onlyoffice/MailServer/logs
创建mailserver容器
- sudo docker run --init --net onlyoffice --privileged -i -t -d --restart=always --name onlyoffice-mail-server -p 26:25 -p 143:143 -p 587:587 \
- -e MYSQL_SERVER=onlyoffice-mysql-server \
- -e MYSQL_SERVER_PORT=3306 \
- -e MYSQL_ROOT_USER=root \
- -e MYSQL_ROOT_PASSWD=password \
- -e MYSQL_SERVER_DB_NAME=onlyoffice_mailserver \
- -v /opt/onlyoffice/MailServer/data:/var/vmail \
- -v /opt/onlyoffice/MailServer/data/certs:/etc/pki/tls/mailserver \
- -v /opt/onlyoffice/MailServer/logs:/var/log \
- -h yourdomain.com \
- onlyoffice/mailserver
community Server 是一个开源的协作平台,包括文档管理、项目管理、邮件管理、成员管理等功能。
目录
- mkdir -p /opt/onlyoffice/CommunityServer/data
- mkdir -p /opt/onlyoffice/CommunityServer/logs
- mkdir -p /opt/onlyoffice/CommunityServer/letsencrypt
获取MAIL_SERVER_API_HOST
echo "$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' onlyoffice-mail-server)"
创建communityserver容器
MAIL_SERVER_API_HOST的值需替换成上面获取的IP地址
docker run --net onlyoffice -i -t -d --privileged --restart=always --name onlyoffice-community-server -p 80:80 -p 443:443 -p 5222:5222 --cgroupns=host \ -e MYSQL_SERVER_ROOT_PASSWORD=my-secret-pw \ -e MYSQL_SERVER_DB_NAME=onlyoffice \ -e MYSQL_SERVER_HOST=onlyoffice-mysql-server \ -e MYSQL_SERVER_USER=onlyoffice_user \ -e MYSQL_SERVER_PASS=onlyoffice_password \ -e DOCUMENT_SERVER_PORT_80_TCP_ADDR=onlyoffice-document-server \ -e MAIL_SERVER_API_HOST=mail_server_ip \ -e MAIL_SERVER_DB_HOST=onlyoffice-mysql-server \ -e MAIL_SERVER_DB_NAME=onlyoffice_mailserver \ -e MAIL_SERVER_DB_PORT=3306 \ -e MAIL_SERVER_DB_USER=root \ -e MAIL_SERVER_DB_PASS=password \ -e CONTROL_PANEL_PORT_80_TCP=80 \ -e CONTROL_PANEL_PORT_80_TCP_ADDR=onlyoffice-control-panel \ -v /opt/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data \ -v /opt/onlyoffice/CommunityServer/logs:/var/log/onlyoffice \ -v /opt/onlyoffice/CommunityServer/letsencrypt:/etc/letsencrypt \ -v /sys/fs/cgroup:/sys/fs/cgroup:rw \ onlyoffice/communityserver
按照1至6步安装完成后,就可以使用网址:http://IP地址:80 打开系统页面,首次打开会要求设置administrator用户的密码以及email
注册完成后会调整至下面的登录页面
使用注册时候的邮箱和密码登录后进入系统主页面
如果只想使用文档,可以在设置里面不显示其他功能
在创建文档前,需要设置下文件服务地址,否则打开文档时会提示:下载失败!
设置---文件服务---文件服务位置,修改成:http://IP地址:80
1)使用onlyoffice创建文档时候提示:文档安全令牌的格式不正确
documentserver容器启动时添加参数:-e JWT_ENABLED=false
设置不使用安全秘钥
2)添加其他字体----documentserver容器
参考:
onlyoffice的Linux下的安装、中文字体、字号_onlyoffice 安装字体
OnlyOffice添加中文字体和修改字号_onlyoffice 字体列表加入宋体
3)文档备份
设置------>控制面板------>backup------>Computer file
设置备份的服务器路径(在communityserver容器内),现在设置的是:/var/www/onlyoffice/Data/backup
宿主机目录:/opt/onlyoffice/CommunityServer/data/backup
文档在压缩包的路径(参考):
localhost_***.tar.gz\localhost_***.tar\storage\files\temp\8190c68d-f6d7***\localhost-download-2024-03-10.zip
4)上传文件大小控制
参考:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。