openoffice 部署步骤

部署步骤:vim

1.tar -zxvf Apache_OpenOffice_4.1.6_Linux_x86-64_install-rpm_zh-CN.tar.gz缓存

2.yum localinstall openoffice4.1.6-redhat-menus-4.1.6-9790.noarch.rpm服务器

3.运行:/opt/openoffice4/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizardless

4.出错:/opt/openoffice4/program/soffice.bin: error while loading shared libraries: libXext.so.6: cannot open shared object file: No such file or directorysocket

5.yum install libXext.x86_64字体

6.no suitable windowing system found, exitingui

7.yum groupinstall "X Window System"spa

8.nohup /opt/openoffice4/program/soffice -headless -accept="socket,host=192.168.100.128,port=8100;urp;" -nofirststartwizard &code

9.中文不显示问题:部署

CentOS7安装字体库

在CentOS7服务器上,利用LibreOffice将word等格式转换为PDF,发现不支持汉字。须要安装字体库。

安装fontconfig

yum -y install fontconfig

安装完成后,/usr/share目录就能够看到fonts和fontconfig两个目录。

安装ttmkfdir

yum -y install ttmkfdir

检查已有字体库

fc-list

复制字体

#新建文件夹
mkdir /usr/share/fonts/chinese

把Windows系统的字体C:\Windows\Fonts复制进去。

  • simsun.ttc 宋体
  • simhei.ttf 黑体
  • msyh.ttf 微软雅黑
  • msyhbd.ttf 微软雅黑
# 修改字体权限
chmod -R 644 /usr/share/fonts/chinese

汇总生成fonts.scale文件

ttmkfdir -e /usr/share/X11/fonts/encodings/encodings.dir

修改字体配置文件

vim /etc/fonts/fonts.conf

修改内容

<fontconfig>
  ....
  <dir>....
  <dir>/usr/share/fonts/chinese</dir>
  ....
</fontconfig>

更新字体缓存

fc-cache -fv

OK