当前位置:首页 > 分享 > 经验 > 正文内容

onlyoffice 源码编译,破解20连接数限制,并部署到centos7

watrt4年前 (2020-10-30)经验76031

前言

1.本教程用于从源码编译onlyoffice,顺便破解20可编辑的限制。

2.将生成包部署到另外一台设备上的部署过程。

一、环境准备

编译环境:ubuntu 1404(一定要用这个版本)

测试环境:centos7 

代理:必须保证顺畅链接,否则编译非常困难

*建议将防火墙关闭进行测试。

二、编译

参考链接:https://helpcenter.onlyoffice.com/server/linux/document/compile-source-code.aspx

链接比较详细,依次执行即可,下面主要介绍代理使用的位置:

在执行  “./automate.py server”命令之前执行

git config --global http.proxy 172.16.10.240:xxx
export https_proxy="http://172.16.10.240:xxx"
./automate.py server

此处等待N小时

验证程序:https://api.onlyoffice.com/editors/example/java 

使用程序验证部署是否成功

三、破解

1:修改位置: build_tools目录/server/Common/sources/contants.js

exports.LICENSE_CONNECTIONS = 20;#将此处修改你想要的连接数

2. 再次编译:

首先修改  automate.py 文件

build_tools_params = ["--branch", branch, 
                      "--module", modules, 
                      "--update", "0", #此处修改为0,否则会覆盖你修改的文件
                      "--qt-dir", os.getcwd() + "/qt_build/Qt-5.9.9"]

执行编译

git config --global http.proxy 172.16.10.240:xxx
export https_proxy="http://172.16.10.240:xxx"
./automate.py server

再次等待N小时(欢迎大神能赐教能够单独打包的方式)

尝试是否可以打开超过20个连接限制

四、将编译后的文件部署到centos

环境准备

#安装nginx

yum install nginx

#修改配置文件 /etc/nginx/nginx.conf

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    map $http_host $this_host {
  "" $host;
  default $http_host;
}
map $http_x_forwarded_proto $the_scheme {
  default $http_x_forwarded_proto;
  "" $scheme;
}
map $http_x_forwarded_host $the_host {
  default $http_x_forwarded_host;
  "" $this_host;
}
map $http_upgrade $proxy_connection {
  default upgrade;
  "" close;
}
    proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $the_host;
proxy_set_header X-Forwarded-Proto $the_scheme;
    server {
        listen       80;
        server_name  localhost;
        rewrite ^\/OfficeWeb(\/apps\/.*)$ /web-apps$1 redirect;
        location / {
   proxy_pass http://localhost:8000;
   proxy_http_version 1.1;
}
location /spellchecker/ {
   proxy_pass http://localhost:8080/;
   proxy_http_version 1.1;
}
    }
}

#重启

nginx -s stop
nginx

#安装rabbitmq

rpm -Uvh https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/Packages/e/epel-release-7-12.noarch.rpm
yum install erlang

# 下载rabbitmq

wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.15/rabbitmq-server-3.6.15-1.el7.noarch.rpm

# 安装rabbitmq

yum install rabbitmq-server-3.6.15-1.el7.noarch.rpm

# 启动rabbitmq服务

service rabbitmq-server start

#安装postgresql,参考编译环境的部署方式

  将生成的文件复制到centos上

  编译环境目录:build_tools/out   

  centos目录:/root/onlyoffice/out(可以是任意目录)

  设置执行权限

   chmod -R  777   /root/onlyoffice/out/linux_64/onlyoffice/documentserver/server/FileConverter
   chmod -R 777 /root/onlyoffice/out/linux_64/onlyoffice/documentserver/server/DocService
   chmod -R 777 /root/onlyoffice/out/linux_64/onlyoffice/documentserver/server/SpellChecker/spellchecker

   启动

  参照编译环境启动(可以不用生成 fonts 和 themes)

分享给朋友:

相关文章

Unicode 编码 范围

Unicode 编码 范围

0000−007F基本拉丁字母0080−00FF拉丁文补充10100−017F拉丁文扩展A0180−024F拉丁文扩展B0250−02AF国际音标扩展02B0−02FF占位修饰符号0300−036F结合附加符号0370−03FF希腊字母及科普特字母0400−04FF西里尔字母0500−052F西里尔字母补充0530−058F亚美尼亚字母0590−05FF希伯来文0600−06FF阿拉伯文0700−074F叙利亚文0750−077F阿拉伯文补充0780−07BF它拿字母07C0−07FF西非书面语...

lcr-t4 晶体管测试仪更新固件

lcr-t4 晶体管测试仪更新固件

固件和手册transistortester1.21k.zipavrdudeprog33.zip通过创建具有以下功能的.bat文件(并指定适当的COM端口),也可以轻松地直接从Windows中的命令行进行编程:REM Writing Flash + EEPROM + Fuses (L=F7, H=D9, E=FC) avrdude -c avrisp -p m328p...

包管理换国内源

包管理换国内源

Pip提供方源及使用方式豆瓣https://pypi.doubanio.com/simple/pip install -i https://pypi.doubanio.com/simple/清华大学https://pypi.tuna.tsinghua.edu.cn/simplepip install -i https://pypi.tuna.tsinghua.edu.cn/simple阿里云https://mirrors.aliyun....

评论列表

eason
eason IP:
3年前 (2021-03-10)

不需要构建两遍,在构建途中server源码clone下来之后停止,修改js文件。 继续执行命令打包

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。