根据官网进行安装
安装 ONLYOFFICE Workspace 的最简单方法是使用我们的 Docker 脚本。如果希望完全控制安装过程,则可以手动安装所有组件。
ONLYOFFICE Workspace 包括以下组件:ONLYOFFICE Community Server、ONLYOFFICE Control Panel、ONLYOFFICE Docs 和 ONLYOFFICE Mail。要安装所有这些并相互集成,请按照以下步骤操作。
CPU 至少为 4 核(建议使用 6 核), 内存至少 8 GB(建议 12 GB), 硬盘至少 40 GB 可用空间, 交换至少 4GB,但取决于主机操作系统。越多越好 操作系统 amd64 Linux 发行版,内核版本 3.10 或更高版。
在开始安装之前,需要创建以下文件夹:
sudo mkdir -p "/app/onlyoffice/mysql/conf.d";
sudo mkdir -p "/app/onlyoffice/mysql/data";
sudo mkdir -p "/app/onlyoffice/mysql/initdb";
sudo mkdir -p "/app/onlyoffice/CommunityServer/data";
sudo mkdir -p "/app/onlyoffice/CommunityServer/logs";
sudo mkdir -p "/app/onlyoffice/CommunityServer/letsencrypt";
sudo mkdir -p "/app/onlyoffice/DocumentServer/data";
sudo mkdir -p "/app/onlyoffice/DocumentServer/logs";
sudo mkdir -p "/app/onlyoffice/MailServer/data/certs";
sudo mkdir -p "/app/onlyoffice/MailServer/logs";
sudo mkdir -p "/app/onlyoffice/ControlPanel/data";
sudo mkdir -p "/app/onlyoffice/ControlPanel/logs";
sudo docker network create --driver bridge onlyoffice
echo "[mysqld]
sql_mode = 'NO_ENGINE_SUBSTITUTION'
max_connections = 1000
max_allowed_packet = 1048576000
group_concat_max_len = 2048" > /app/onlyoffice/mysql/conf.d/onlyoffice.cnf
echo "ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'my-secret-pw';
CREATE USER IF NOT EXISTS 'onlyoffice_user'@'%' IDENTIFIED WITH mysql_native_password BY 'onlyoffice_pass';
CREATE USER IF NOT EXISTS 'mail_admin'@'%' IDENTIFIED WITH mysql_native_password BY 'Isadmin123';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'onlyoffice_user'@'%';
GRANT ALL PRIVILEGES ON *.* TO 'mail_admin'@'%';
FLUSH PRIVILEGES;" > /app/onlyoffice/mysql/initdb/setup.sql
docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-mysql-server -v /app/onlyoffice/mysql/conf.d:/etc/mysql/conf.d -v /app/onlyoffice/mysql/data:/var/lib/mysql -v /app/onlyoffice/mysql/initdb:/docker-entrypoint-initdb.d -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_DATABASE=onlyoffice mysql:8.0.29
docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-document-server -p 9001:80 -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/DocumentServer/fonts:/usr/share/fonts/truetype/custom -v /app/onlyoffice/DocumentServer/forgotten:/var/lib/onlyoffice/documentserver/App_Data/cache/files/forgotten -e JWT_ENABLED=false onlyoffice/documentserver
注:-e JWT_ENABLED=false,设置不使用安全秘钥,需要请参考生成秘钥
docker run --init --net onlyoffice --privileged -i -t -d --restart=always --name onlyoffice-mail-server -p 25: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=my-secret-pw -e MYSQL_SERVER_DB_NAME=onlyoffice_mailserver -v /app/onlyoffice/MailServer/data:/var/vmail -v /app/onlyoffice/MailServer/data/certs:/etc/pki/tls/mailserver -v /app/onlyoffice/MailServer/logs:/var/log -h 192.168.253.6 onlyoffice/mailserver
注:将用于维护通信的域必须有效并为此计算机配置(即,它应该在DNS设置中具有适当的A记录,该记录将您的域名指向安装ONLYOFFICE Mail的计算机的IP地址)。
在上面的命令中,必须将该参数理解为 ONLYOFFICE Mail 的服务域。它通常在将用于维护通信的域的 MX 记录中指定。通常,看起来像"yourdomain.com""yourdomain.com"mx1.onlyoffice.com。
这个需要AD域,暂时我不进行安装。
docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-control-panel -v /var/run/docker.sock:/var/run/docker.sock -v /app/onlyoffice/CommunityServer/data:/app/onlyoffice/CommunityServer/data -v /app/onlyoffice/ControlPanel/data:/var/www/onlyoffice/Data -v /app/onlyoffice/ControlPanel/logs:/var/log/onlyoffice onlyoffice/controlpanel
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_pass -e DOCUMENT_SERVER_PORT_80_TCP_ADDR=onlyoffice-document-server -e CONTROL_PANEL_PORT_80_TCP=80 -e CONTROL_PANEL_PORT_80_TCP_ADDR=onlyoffice-control-panel -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice -v /app/onlyoffice/CommunityServer/letsencrypt:/etc/letsencrypt -v /sys/fs/cgroup:/sys/fs/cgroup:rw onlyoffice/communityserver
官方集成代码示例下载
files.docservice.url.site=http://192.168.253.6:9001/
java -jar integration-1.0.jar