ubuntu16.04上onlyoffice环境搭建

1、安装onlyoffice镜像

  1. 安装 DocumentServer

    sudo docker run -i -t -d --name onlyoffice -p 9980:80 \

       -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice  \
       -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data  \
       -v /app/onlyoffice/DocumentServer/sdkjs-plugins:/var/www/onlyoffice/documentserver/sdkjs-plugins \
       -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice  onlyoffice/documentserver

    备注:

        其中-v /app/onlyoffice/DocumentServer/sdkjs-plugins:/var/www/onlyoffice/documentserver/sdkjs-plugins

        将documentserver的插件目录挂载到宿主机上,这样我们就可以愉快地开发插件无缝连接到documentserver里面

  2. 打开浏览器http://192.168.1.154:9980,onlyofficer服务器正在运行


2、node服务器搭建

  1. 安装 nodejs:
    curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - (可跳过这一步)
    sudo apt-get install -y nodejs
  2. 下载Node.js工程并解压:
    wget https://api.onlyoffice.com/app_data/editor/Node.js%20Example.zip
    unzip Node.js\ Example.zip
  3. 进入工程目录:
    cd Node.js\ Example/
  4. 安装依赖包:
    npm install
  5. 编辑配置文件,指定ONLYOFFICE Document Server 服务器ip.
    nano config/default.json

    Edit the following lines:

    "siteUrl": "http://192.168.1.154:9980/"
    

    Where the documentserver is the name of the server with the ONLYOFFICE Document Server installed.

  6. 用node运行工程:
    nodejs bin/www
  7. 打开浏览器,可创建和上传文档:
    http://192.168.1.154:3000


参考官方网站:

官网:https://www.onlyoffice.com/

开发文档:https://api.onlyoffice.com/

猜你喜欢

转载自blog.csdn.net/ypbsyy/article/details/80272998