onlyoffice mysql_windows+onlyoffice安装-Go语言中文社区
1.安装介质与顺序
vcredist_x86.exe
vcredist_x64.exe
otp_win64_20.0.exe
python-2.7.6.msi
node-v6.11.3-x64.msi(不改默认安装路径)
Redis-x64-3.2.100.msi
rabbitmq-server-3.6.11.exe
onlyoffice-documentserver5.0.4.exe
mysql-installer-community-5.7.19.0.msi
SQLyog.Ultimate.v8.2
检查redis安装是否成功:
进入Redis的目录,cd C:Program FilesRedis。输入redis-cli并回车
显示正确端口号,则表示服务已经启动。
检查rabbitMQ安装是否成功:
配置环境变量:
ERLANG_HOME C:Program Fileserl9.0
PATH %ERLANG_HOME%bin
RABBITMQ_SERVER C:Program FilesRabbitMQ Serverrabbitmq_server-3.6.11
PATH %RABBITMQ_SERVER%sbin
以管理员身份运行cmd.exe,进入目录C:Program FilesRabbitMQ Serverrabbitmq_server-3.6.11sbin(RabbitMQ Server安装目录),运行cmd命令:rabbitmq-plugins.bat enable rabbitmq_management
运行命令:net stop RabbitMQ && net start RabbitMQ
浏览器输入地址:http://localhost:15672,输入默认账号:guest 密码:guest,就能进入RabbitMQ界面了
出现 z:.erlang.cookie创建失败 请同步Erlang Cookies
操作:将 C:WINDOWS.erlang.cookie 拷贝到 C:Users%USERNAME%.erlang.cookie ,用%USERNAME%账号登陆 重启rabbitMQ
2.配置修改
C:ONLYOFFICEDocumentServerconfigproduction-windows.json 添加mysql数据库配置
"utils": {
"utils_common_fontdir": "C:\Windows\Fonts"
},
"sql": {
"type": "mysql",
"dbHost": "127.0.0.1",
"dbPort": 3306,
"dbUser": "root",
"dbPass": "123456"
}
3.创建数据库
SQLyog.Ultimate.v8.2 连接mysql(root 123456 安装mysql时自己设置的密码),创建onlyoffice,并执行以下建表语句
CREATE TABLE `task_result` (
`id` varchar(255) NOT NULL,
`status` tinyint(3) NOT NULL,
`status_info` int(10) NOT NULL,
`last_open_date` datetime NOT NULL,
`user_index` int(10) unsigned NOT NULL DEFAULT '1',
`change_id` int(10) unsigned NOT NULL DEFAULT '0',
`callback` text NOT NULL,
`baseurl` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `doc_changes` (
`id` varchar(255) NOT NULL,
`change_id` int(10) unsigned NOT NULL,
`user_id` varchar(255) NOT NULL,
`user_id_original` varchar(255) NOT NULL,
`user_name` varchar(255) NOT NULL,
`change_data` longtext NOT NULL,
`change_date` datetime NOT NULL,
PRIMARY KEY (`id`,`change_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
4.运行服务
运行C:ONLYOFFICEDocumentServerbindocumentserver-generate-allfonts.bat 生成字体
重启onlyoffice服务
ONLYOFFICE DocumentServer Converter Service
ONLYOFFICE DocumentServer DocService Service
ONLYOFFICE DocumentServer Gc Service
ONLYOFFICE DocumentServer Proxy Service
ONLYOFFICE DocumentServer Spellchecker Service
访问应用
http://localhost/welcome/ 会出现以下页面
注:
缓存路径
C:ONLYOFFICEDocumentServerserverApp_Datacachefiles
乱码修改文件(预览出现乱码时将对应字体后的数字改成与非乱码字体一致,直接改AllFonts.js字体 对应数组,注意清理浏览器缓存)
C:ONLYOFFICEDocumentServersdkjscommonAllFonts.js
具体调用代码:
String erro=null;
String fileId=null;
Attachment attachment=null;
String documentType=null;
String fileType=null;
FileItem fileItem=null;
try{
fileId=request.getParameter("fileId");
if(fileId!=null){
AttachmentService attachmentService=SpringUtil.getBean(AttachmentService.BEAN_ID);
attachment=(Attachment)attachmentService.get(Attachment.class, Long.parseLong(fileId));
if(attachment==null){
throw new BusinessException("错误的fileId:"+fileId);
}
String fileName=attachment.getFileName();
fileType=FileUtils.getFileType(fileName).toLowerCase();
if("docx".equals(fileType)||"doc".equals(fileType)
||"odt".equals(fileType)||"txt".equals(fileType)
||"rtf".equals(fileType)||"html".equals(fileType)
||"htm".equals(fileType)||"mht".equals(fileType)
||"epub".equals(fileType)||"pdf".equals(fileType)
||"djvu".equals(fileType)||"xps".equals(fileType)){
documentType="text";
}else if("xlsx".equals(fileType)||"xls".equals(fileType)
||"ods".equals(fileType)||"csv".equals(fileType)
||"xlsb".equals(fileType)||"xlsm".equals(fileType)){
documentType="spreadsheet";
}else if("pptx".equals(fileType)||"ppt".equals(fileType)
||"odp".equals(fileType)||"ppsx".equals(fileType)
||"pps".equals(fileType)){
documentType="presentation";
}else{
throw new BusinessException("不支持的文件类型");
}
}else{
throw new BusinessException("参数fileId和itemId不能为空");
}
}catch(Exception e){
erro="错误信息:"+e.getMessage();
}
%>
ONLYOFFICE
//document (.docx, .doc, .odt, .txt, .rtf, .html, .htm, .mht, .epub, .pdf, .djvu, .xps) for viewing or editing - text
//spreadsheet (.xlsx, .xls, .ods, .csv) for viewing or editing - spreadsheet,
//presentation (.pptx, .ppt, .odp, .ppsx, .pps) for viewing or editing - presentation.
new DocsAPI.DocEditor(
"iframeEditor",
{
width : "100%",
height : "100%",
document : {
"fileType" : "",
"key" : "",
"title" : "",
"url" : "&date=",
"permissions": {
"comment": false,
"download": false,
"edit": false,
"print": true,
"review": false
},
},
documentType : ""
});
onlyoffice mysql_windows+onlyoffice安装-Go语言中文社区相关推荐
- go给Linux安装mysql_Linux安装MySQL-Go语言中文社区
1.下载并上传到/opt/soft目录 2.解压: tar -xvf mysql-5.7.27-1.e17.x86_64.rpm-bundle.tar 3.清空linux自带的数据库 1.查看是否有旧 ...
- .tar.gz mysql 安装_mysql tar.gz 版本 linux系统的安装-Go语言中文社区
mysql下载地址: https://dev.mysql.com/downloads/mysql/ 1. 上传下载的tar.gz文件发送到linux 上传的路径: /usr/local/mysql/ ...
- linux安装grpc占用空间大,grpc linux安装-Go语言中文社区
1. go protobuf 安装 Protoc Buffer 安装包下载地址:https://github.com/protocolbuffers/protobuf/releases/downloa ...
- 源码包编译安装python_Python3.7源码包编译安装-Go语言中文社区
环境: [root@localhost python3]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) [root@loc ...
- go语音protobuf_总结一下protobuf安装-Go语言中文社区
protobuf可以在github上:https://github.com/google/protobuf 或者直接下载2.6.1版本:https://github.com/google/protob ...
- rmp mysql_mysql 的rmp安装-Go语言中文社区
最近在学习mysql,发现其实在linux下安装的时候还是挺麻烦的,于是做个记录和大家分享,不足之处,欢迎留言指正 一,下载并上传至linux 首先下载tar文件放到/usr/local/链接:htt ...
- R语言中文社区2018年终文章整理(作者篇)
欢迎关注天善智能,我们是专注于商业智能BI,人工智能AI,大数据分析与挖掘领域的垂直社区,学习,问答.求职一站式搞定! 对商业智能BI.大数据分析挖掘.机器学习,python,R等数据领域感兴趣的同学 ...
- 精心整理 | R语言中文社区历史文章整理(类型篇)
2018年过去一半了~又到了盘点的时间~感谢长时间来各位好友的关注,我们的成长与你们的爱护是分不开的.更感谢各位老师的投稿,支撑起了我们的这个社区,让更多R语言的爱好者和从业者获得最棒的知识!本文选取 ...
- rust的矿坑_转: Rust中的Pin详解 【Rust语言中文社区】
Rust中的Pin详解 原创 automanyang Rust语言中文社区 昨天 https://mp.weixin.qq.com/s/PjctbPbyR5OeaqTHZdB5uQ 相关概念 Pin ...
最新文章
- vin端口是什么意思_端口有无开启
- 进击的UI---------------UIPickerView
- 高老师的架构设计_隽语集(CC_1201)
- spring data jpa实现有条件的分页查询功能
- jdba怎么连接mysql_一、JAVA通过JDBC连接mysql数据库(连接)
- 设计师的10种范式转变
- 解题报告 『[Poetize6]IncDec Sequence(差分)』
- linux grep 日期,linux 文本处理工具之一grep命令详解
- AllWinner T113交叉工具链篇
- 第十届山东省ACM程序设计竞赛(部分题解)
- 魔方机器人之搭建Python编程环境
- SPSS Modeler数据挖掘:回归分析
- Jmeter性能测试之测试报告
- 通关《Diablo2》12遍纪念
- 网管员必知:常用电脑密码破解(转)
- graphpad7.04多组比较p值_手把手教你用Graphpad做单因素方差分析
- 英语口语六级模拟测试软件,2016年11月英语六级考试口语试题模拟
- 【金融量化】深度学习在金融中的研究热点以及应用
- 服务网格和 API 网关之间的差异​
- mac python2.7升级到3.7_Mac下python2.7 升级到3.7
热门文章
- 51单片机设计多功能电子秤(实训项目)
- selenium爬取巨潮资讯指定领域下所有上市公司的数据并存储到csv文件
- 控制系统仿真技术(二)-连续系统的数字仿真二
- 学微积,用手机;勇于创新,敢于实践
- socks5进程代理模拟器单窗口单IP软件分享及使用教程
- 06-HTML5新增元素
- SS54/SS24/SS510及SMA/SMB/SMC不同封装区别
- RPA077-调用飞书API发送文件(.net→c#)
- 戴尔笔记本(戴尔G7)调节散热器功率。
- vue 组件封装 确认弹框带可以自定义titile ,内容,和取消,确定按钮的弹窗 slot插槽