windows上安装onlyoffice

作者: zengde 分类: 笔记 发布时间: 2019-03-12 06:17

首先下载onlyoffice documentserver的windows程序安装包,第一次安装后无法正常运行

1.安装其他依赖redis,erlang,rabbitmq

启用rabbitmq的web管理插件,进入rabbitmq安装目录/sbin

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
rabbitmq-plugins.bat enable rabbitmq_management
rabbitmq-plugins.bat enable rabbitmq_management
rabbitmq-plugins.bat enable rabbitmq_management

2.修改配置

安装目录/config/default.json修改sql段

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
"sql": {
"type": "mysql",
"tableChanges": "doc_changes",
"tableResult": "task_result",
"dbHost": "127.0.0.1",
"dbPort": 3308,
"dbUser": "root",
"dbPass": "root",
"dbName": "onlyoffice",
"charset": "utf8",
"connectionlimit": 10,
"max_allowed_packet": 1048575
}
"sql": { "type": "mysql", "tableChanges": "doc_changes", "tableResult": "task_result", "dbHost": "127.0.0.1", "dbPort": 3308, "dbUser": "root", "dbPass": "root", "dbName": "onlyoffice", "charset": "utf8", "connectionlimit": 10, "max_allowed_packet": 1048575 }
"sql": {
  "type": "mysql",
  "tableChanges": "doc_changes",
  "tableResult": "task_result",
  "dbHost": "127.0.0.1",
  "dbPort": 3308,
  "dbUser": "root",
  "dbPass": "root",
  "dbName": "onlyoffice",
  "charset": "utf8",
  "connectionlimit": 10,
  "max_allowed_packet": 1048575
}

再运行安装目录/server/schema/mysql/createdb.sql文件

3.手动安装

cnpm install –global –production windows-build-tools

进入安装目录/server/speechecker的package.json移除nodehun

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
cnpm install nodehun --save
cnpm install
cnpm install nodehun --save cnpm install
cnpm install nodehun --save
cnpm install

之后在计算机管理中重启onlyoffice documentserver Docservice,打开http://localhost:8000/welcome查看服务是否已正常

php-integration的config.php中配置

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$GLOBALS['DOC_SERV_CONVERTER_URL'] = "http://localhost:8000/ConvertService.ashx";
$GLOBALS['DOC_SERV_API_URL'] = "http://localhost:8000/web-apps/apps/api/documents/api.js";
$GLOBALS['DOC_SERV_PRELOADER_URL'] = "http://localhost:8000/web-apps/apps/api/documents/cache-scripts.html";
$GLOBALS['EXAMPLE_URL'] = "http://localhost:88/demo/onlyoffice";
$GLOBALS['DOC_SERV_CONVERTER_URL'] = "http://localhost:8000/ConvertService.ashx"; $GLOBALS['DOC_SERV_API_URL'] = "http://localhost:8000/web-apps/apps/api/documents/api.js"; $GLOBALS['DOC_SERV_PRELOADER_URL'] = "http://localhost:8000/web-apps/apps/api/documents/cache-scripts.html"; $GLOBALS['EXAMPLE_URL'] = "http://localhost:88/demo/onlyoffice";
$GLOBALS['DOC_SERV_CONVERTER_URL'] = "http://localhost:8000/ConvertService.ashx";
$GLOBALS['DOC_SERV_API_URL'] = "http://localhost:8000/web-apps/apps/api/documents/api.js";
$GLOBALS['DOC_SERV_PRELOADER_URL'] = "http://localhost:8000/web-apps/apps/api/documents/cache-scripts.html";
$GLOBALS['EXAMPLE_URL'] = "http://localhost:88/demo/onlyoffice";

出现undefined index时修改相关代码,打开http://localhost:88/demo/onlyoffice进行上传并在线查看和编辑文档

zengde个人的小站