温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

CentOS7服务器如何搭建OpenOffice

发布时间:2022-01-19 15:50:08 来源:亿速云 阅读:316 作者:小新 栏目:开发技术

这篇文章主要介绍了CentOS7服务器如何搭建OpenOffice,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

参考文档链接:

  • https://www.openoffice.org/download/common/instructions.html

  • https://wiki.openoffice.org/wiki/Documentation/FAQ/Installation

  • http://zh-cn.libreoffice.org/get-help/install-howto/linux/

wget https://jaist.dl.sourceforge.net/project/openofficeorg.mirror/4.1.3/binaries/zh-CN/Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz
tar -zxvf Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz
mv zh-CN Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN                           // 解压后文件夹为zh-CN,为了方便识别,进行重命名
cd Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN/RPMS
rpm -Uvih *rpm

自启动

修改脚本文件

vim /etc/rc.d/rc.local

文件末尾增加以下脚本

/opt/openoffice4/program/soffice --accept="socket,host=127.0.0.1,port=8100;urp;StarOffice.ServiceManager" --headless --nofirststartwizard --nologo &

如该文件没有执行权限,则给予执行权限

chmod +x /etc/rc.d/rc.local

以下是使用systemd的方式启动,但会出现cpu占用率100%的情况,先做记录,暂时不用。

创建启动文件

vim /usr/lib/systemd/system/openoffice.service

[Unit]
Description=OpenOffice service
After=syslog.target
[Service]
Environment="JAVA_HOME=/opt/java/default"
ExecStart=/opt/openoffice4/program/soffice --accept="socket,host=127.0.0.1,port=8100;urp;StarOffice.ServiceManager" --headless --nofirststartwizard --nologo
Restart=always
KillSignal=SIGQUIT
Type=simple
StandardError=syslog
NotifyAccess=all
User=tomcat

[Install]
WantedBy=multi-user.target

openoffice自启动

systemctl daemon-reload
systemctl enable openoffice
systemctl start openoffice

LibreOffice

也可以使用LibreOffice作为文档转换服务,但word转html还是要OpenOffice效果好一些。

wget http://mirrors.ustc.edu.cn/tdf/libreoffice/stable/5.2.6/rpm/x86_64/LibreOffice_5.2.6_Linux_x86-64_rpm.tar.gz
tar -zxvf LibreOffice_5.2.6_Linux_x86-64_rpm.tar.gz
cd LibreOffice_5.2.6.2_Linux_x86-64_rpm/RPMS
yum install *.rpm

# 如需卸载,使用以下命令
yum remove libreoffice*

如果使用libreoffice,则启动参数为:

ExecStart=/usr/bin/soffice --accept="socket,host=127.0.0.1,port=8100;urp;StarOffice.ServiceManager" --headless --nofirststartwizard --nologo --nodefault --nocrashreport --nolockcheck
# 或
ExecStart=/usr/bin/soffice --accept="socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" --headless --nofirststartwizard --nologo --nodefault --nocrashreport --nolockcheck  --norestore
# 或
ExecStart=/opt/libreoffice5.2/program/soffice --accept="socket,host=127.0.0.1,port=8100;urp;StarOffice.ServiceManager" --headless --nofirststartwizard --nologo --nodefault --nocrashreport --nolockcheck

感谢你能够认真阅读完这篇文章,希望小编分享的“CentOS7服务器如何搭建OpenOffice”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI