最新要闻

广告

手机

iphone11大小尺寸是多少?苹果iPhone11和iPhone13的区别是什么?

iphone11大小尺寸是多少?苹果iPhone11和iPhone13的区别是什么?

警方通报辅警执法直播中被撞飞:犯罪嫌疑人已投案

警方通报辅警执法直播中被撞飞:犯罪嫌疑人已投案

家电

ONLYOFFICE 安装对接指南

来源:博客园

ONLYOFFICE 文档是一个在线办公套件,包括文本文档、电子表格和演示文稿的查看器和编辑器,与包括 .docx、.xlsx、.pptx 在内的 Office Open XML 格式完全兼容,并支持实时协作编辑。为了安装这系统,也踩了不少坑,以下将我的安装过程分享下


(资料图)

Docker安装

添加docker下载仓库

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

安装docker-ce

sudo yum install docker-ce

启动docker-ce

systemctl start dockersystemctl enable docker

验证

docker --versiondocker run hello-world

Docker Compose 安装

yum install epel-releaseyum install -y python-pippip install docker-compose

报错Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-RkuQr1/setuptools/

解决方法1

如果在升级过程中报标题中的错误,则通过gt-pip.py文件进行安装(以python2.7为例):

先卸载安装的python-pipsudo yum remove python-pip下载get-pip.py文件

wget https://bootstrap.pypa.io/pip/2.7/get-pip.pysudo python get-pip.py

解决方法2

如果安装了python2-pip或者python-pip,先卸载yum -y remove python2-pip python-pip安装python2-pipyum -y install python2-pip安装zabbix-apipip install zabbix-api

配置安装目录

创建映射目录,并授权

rm -rf /home/onlyofficemkdir -p /home/onlyoffice/DocumentServer/logsmkdir -p /home/onlyoffice/DocumentServer/datamkdir -p /home/onlyoffice/DocumentServer/libmkdir -p /home/onlyoffice/DocumentServer/rabbitmqmkdir -p /home/onlyoffice/DocumentServer/redismkdir -p /home/onlyoffice/DocumentServer/db

docker-compose配置

version: "2"services:  onlyoffice-documentserver:    image: onlyoffice/documentserver-de:7.3.3.49    container_name: onlyoffice-documentserver    depends_on:      - onlyoffice-postgresql      - onlyoffice-rabbitmq    environment:      - DB_TYPE=postgres      - DB_HOST=onlyoffice-postgresql      - DB_PORT=5432      - DB_NAME=onlyoffice      - DB_USER=onlyoffice      - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq      # Uncomment strings below to enable the JSON Web Token validation.      #- JWT_ENABLED=true      #- JWT_SECRET=secret      #- JWT_HEADER=Authorization      #- JWT_IN_BODY=true    ports:      - "80:80"      - "443:443"    stdin_open: true    restart: always    stop_grace_period: 60s    volumes:          - /home/onlyoffice/DocumentServer/logs:/var/log/onlyoffice          - /home/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data          - /home/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice          - /home/onlyoffice/DocumentServer/rabbitmq:/var/lib/rabbitmq          - /home/onlyoffice/DocumentServer/redis:/var/lib/redis          - /home/onlyoffice/DocumentServer/db:/var/lib/postgresql         onlyoffice-rabbitmq:    container_name: onlyoffice-rabbitmq    image: rabbitmq    restart: always    expose:      - "5672"  onlyoffice-postgresql:    container_name: onlyoffice-postgresql    image: postgres:9.5    environment:      - POSTGRES_DB=onlyoffice      - POSTGRES_USER=onlyoffice      - POSTGRES_HOST_AUTH_METHOD=trust    restart: always    expose:      - "5432"    volumes:      - postgresql_data:/var/lib/postgresqlvolumes:  postgresql_data:

配置完成后进入目录 执行 docker-compose up -d进行安装

查看secret

sudo docker exec [容器ID] /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json "services.CoAuthoring.secret.session.string"

官方实例

官方提供了各种语言的demo,以下为下载官方地址https://api.onlyoffice.com/editors/demopreview#security

VUE实例

https://github.com/wytxer/demo-onlyoffice

实例配置

实例部署的时候很多人运行起来发现没有编辑权限,这个我第一次运用也是,因为我用的是localhost地址,官方是不允许这个的,所以我们要么部署上服务器,要么用本地的ipconfig /all查看本机IP来运行实例才行

以下为一些参考资料

http://events.jianshu.io/p/a5e8ef7e9062https://blog.csdn.net/hotqin888/article/details/79337881https://www.jianshu.com/p/6ce4d4ed7adb

关键词: