安装docker
略
安装docker版的ONLYOFFICE Document Server
[root@localhost yum.repos.d]# docker run -i -t -d -p 8001:80 --restart=always onlyoffice/documentserver:6.1
Unable to find image 'onlyoffice/documentserver:6.1' locally
6.1: Pulling from onlyoffice/documentserver
83ee3a23efb7: Pull complete
db98fc6f11f0: Pull complete
f611acd52c6c: Pull complete
12b1112d3a9f: Pull complete
278d7f7bbc81: Pull complete
d83073617c56: Pull complete
b4399eff12bc: Pull complete
Digest: sha256:5dc621a1b12c35de1c63f4271651bacce4d9a59d59547bc2b47c322d2eb46197
Status: Downloaded newer image for onlyoffice/documentserver:6.1
6dff945ac83d5b400f7d2b72df0c864cc82eb7e6ad10a8e4d4cf3be716d1595b
-p: 指定端口映射,格式为:主机(宿主)端口:容器端口
安装完后即可你的ip地址:8001来访问。
打开演示示例
根据欢迎页面上的提示,执行命令即可:
然后访问http://example.com:8001/example/就可以访问演示页面了:
安装中文字体
默认安装后,字体下拉菜单中并没有中文字体,例如宋体,黑体等
删除自带字体
#进入容器的交互界面
docker exec -it [容器id] /bin/bash
cd /usr/share/fonts/
rm -rf *
cd /var/www/onlyoffice/documentserver/core-fonts/
rm -rf *
exit #退出容器,按ctrl+D也可以
安装中文字体
从C:\Windows\Fonts中复制你需要的中文字体到桌面上,然后将这些中文字体拷贝到容器中的指定文件夹。建议也不要安装太多的字体,不然网页加载时会比较慢。
[root@localhost yum.repos.d]# docker cp /root/Fonts/ 6dff945ac83d:/usr/share/fonts/truetype/custom
进入容器,更新字体
[root@localhost yum.repos.d]# docker cp /root/fonts/ 6dff945ac83d:/usr/share/fonts/truetype/custom
lstat /root/fonts: no such file or directory
[root@localhost yum.repos.d]# docker cp ./fonts/ 6dff945ac83d:/usr/share/fonts/truetype/custom
lstat /etc/yum.repos.d/fonts: no such file or directory
[root@localhost yum.repos.d]# ls /root/font/
ls: cannot access /root/font/: No such file or directory
[root@localhost yum.repos.d]# ls /root/fonts/
ls: cannot access /root/fonts/: No such file or directory
[root@localhost yum.repos.d]# ls /root/Fonts/
8514fixe.fon COPRGTB.TTF KUNSTLER.TTF serifft.fon
8514fix.fon COPRGTL.TTF l_10646.ttf SHOWG.TTF
8514fixg.fon corbelb.ttf LATINWD.TTF SIMFANG.FOT
8514fixr.fon corbeli.ttf Lato-Black.ttf simfang.ttf
8514fixt.fon corbelli.ttf Lato-Bold.ttf simhei.ttf
8514oeme.fon corbell.ttf Lato-Regular.ttf simkai.ttf
8514oem.fon corbel.ttf LBRITEDI.TTF SIMLI.TTF
8514oemg.fon corbelz.ttf LBRITED.TTF simsunb.ttf
8514oemr.fon coue1255.fon LBRITEI.TTF simsun.ttc
8514oemt.fon coue1256.fon LBRITE.TTF SIMYOU.TTF
8514syse.fon coue1257.fon LCALLIG.TTF SitkaB.ttc
8514sys.fon couf1255.fon LeelaUIb.ttf SitkaI.ttc
8514sysg.fon couf1256.fon LeelawUI.ttf Sitka.ttc
8514sysr.fon couf1257.fon LeelUIsl.ttf SitkaZ.ttc
8514syst.fon courbd.ttf LFAXDI.TTF smae1255.fon
85775.fon courbi.ttf LFAXD.TTF smae1256.fon
85855.fon couree.fon LFAXI.TTF smae1257.fon
85f1255.fon coure.fon LFAX.TTF smaf1255.fon
85f1256.fon coureg.fon LHANDW.TTF smaf1256.fon
85f1257.fon courer.fon LSANSDI.TTF smaf1257.fon
85f874.fon couret.fon LSANSD.TTF smallee.fon
85s1255.fon courfe.fon LSANSI.TTF smalle.fon
85s1256.fon courf.fon LSANS.TTF smalleg.fon
85s1257.fon courfg.fon LTYPEBO.TTF smaller.fon
85s874.fon courfr.fon LTYPEB.TTF smallet.fon
AGENCYB.TTF courft.fon LTYPEO.TTF smallfe.fon
AGENCYR.TTF couri.ttf LTYPE.TTF smallf.fon
ALGER.TTF cour.ttf lucon.ttf smallfg.fon
ANTQUABI.TTF CURLZ___.TTF MAGNETOB.TTF smallfr.fon
ANTQUAB.TTF cvgafix.fon MAIAN.TTF smallft.fon
ANTQUAI.TTF cvgasys.fon malgunbd.ttf SNAP____.TTF
app775.fon Dengb.ttf malgunsl.ttf SourceSansPro-Black.otf
app850.fon Dengl.ttf malgun.ttf SourceSansPro-Regular.ttf
app852.fon Deng.ttf marlett.ttf SourceSansPro-Semibold.ttf
app855.fon desktop.ini MATURASC.TTF ssee1255.fon
app857.fon dos737.fon micross.ttf ssee1256.fon
app866.fon dos869.fon mingliub.ttc ssee1257.fon
app932.fon dosapp.fon MISTRAL.TTF ssee874.fon
app936.fon Dosis-SemiBold.ttf mmrtextb.ttf ssef1255.fon
app949.fon DUBAI-BOLD.TTF mmrtext.ttf ssef1256.fon
app950.fon DUBAI-LIGHT.TTF MOD20.TTF ssef1257.fon
arialbd.ttf DUBAI-MEDIUM.TTF modern.fon ssef874.fon
arialbi.ttf DUBAI-REGULAR.TTF monbaiti.ttf sserifee.fon
ariali.ttf ebrimabd.ttf Montserrat-Regular.ttf sserife.fon
ARIALNBI.TTF ebrima.ttf msgothic.ttc sserifeg.fon
ARIALNB.TTF ega40737.fon msjhbd.ttc sserifer.fon
ARIALNI.TTF ega40850.fon msjhl.ttc sserifet.fon
ARIALN.TTF ega40852.fon msjh.ttc sseriffe.fon
arial.ttf ega40857.fon msyhbd.ttc sseriff.fon
ariblk.ttf ega40866.fon msyhl.ttc sseriffg.fon
ARLRDBD.TTF ega40869.fon msyh.ttc sseriffr.fon
bahnschrift.ttf ega40woa.fon msyi.ttf sserifft.fon
BASKVILL.TTF ega80737.fon MTCORSVA.TTF StaticCache.dat
BAUHS93.TTF ega80850.fon MTEXTRA.TTF STCAIYUN.TTF
BELLB.TTF ega80852.fon mvboli.ttf STENCIL.TTF
BELLI.TTF ega80857.fon NIAGENG.TTF STFANGSO.TTF
BELL.TTF ega80866.fon NIAGSOL.TTF STHUPO.TTF
BERNHC.TTF ega80869.fon NirmalaB.ttf STKAITI.TTF
BKANT.TTF ega80woa.fon NirmalaS.ttf STLITI.TTF
BOD_BI.TTF ELEPHNTI.TTF Nirmala.ttf STSONG.TTF
BOD_BLAI.TTF ELEPHNT.TTF ntailub.ttf STXIHEI.TTF
BOD_BLAR.TTF ENGR.TTF ntailu.ttf STXINGKA.TTF
BOD_B.TTF ERASBD.TTF NumberOnly.ttf STXINWEI.TTF
BOD_CBI.TTF ERASDEMI.TTF OCRAEXT.TTF STZHONGS.TTF
BOD_CB.TTF ERASLGHT.TTF OLDENGL.TTF svgafix.fon
BOD_CI.TTF ERASMD.TTF ONYX.TTF svgasys.fon
BOD_CR.TTF FELIXTI.TTF Oswald-Regular.ttf sylfaen.ttf
BOD_I.TTF fms_metadata.xml OUTLOOK.TTF symbol.ttf
BOD_PSTC.TTF FORTE.TTF palabi.ttf tahomabd.ttf
BOD_R.TTF FRABKIT.TTF palab.ttf tahoma.ttf
BOOKOSBI.TTF FRABK.TTF palai.ttf taileb.ttf
BOOKOSB.TTF FRADMCN.TTF pala.ttf taile.ttf
BOOKOSI.TTF FRADMIT.TTF PALSCRI.TTF TCBI____.TTF
BOOKOS.TTF FRADM.TTF PAPYRUS.TTF TCB_____.TTF
BRADHITC.TTF FRAHVIT.TTF PARCHM.TTF TCCB____.TTF
BRITANIC.TTF FRAHV.TTF PERBI___.TTF TCCEB.TTF
BRLNSB.TTF FRAMDCN.TTF PERB____.TTF TCCM____.TTF
BRLNSDB.TTF framdit.ttf PERI____.TTF TCMI____.TTF
BRLNSR.TTF framd.ttf PERTIBD.TTF TCM_____.TTF
BROADW.TTF FREESCPT.TTF PERTILI.TTF teamviewer15.otf
BRUSHSCI.TTF FRSCRIPT.TTF PER_____.TTF TEMPSITC.TTF
BSSYM7.TTF FTLTLT.TTF phagspab.ttf timesbd.ttf
c8514fix.fon FZSTK.TTF phagspa.ttf timesbi.ttf
c8514oem.fon FZYTK.TTF PLAYBILL.TTF timesi.ttf
c8514sys.fon Gabriola.ttf POORICH.TTF times.ttf
calibrib.ttf gadugib.ttf PRISTINA.TTF trebucbd.ttf
calibrii.ttf gadugi.ttf RAGE.TTF trebucbi.ttf
calibrili.ttf GARABD.TTF RAVIE.TTF trebucit.ttf
calibril.ttf GARAIT.TTF REFSAN.TTF trebuc.ttf
calibri.ttf GARA.TTF REFSPCL.TTF verdanab.ttf
calibriz.ttf georgiab.ttf ROCCB___.TTF verdanai.ttf
CALIFB.TTF georgiai.ttf ROCC____.TTF verdana.ttf
CALIFI.TTF georgia.ttf ROCKBI.TTF verdanaz.ttf
CALIFR.TTF georgiaz.ttf ROCKB.TTF vga737.fon
CALISTBI.TTF GIGI.TTF ROCKEB.TTF vga775.fon
CALISTB.TTF GILBI___.TTF ROCKI.TTF vga850.fon
CALISTI.TTF GILB____.TTF ROCK.TTF vga852.fon
CALIST.TTF GILC____.TTF roman.fon vga855.fon
cambriab.ttf GILI____.TTF s8514fix.fon vga857.fon
cambriai.ttf GILLUBCD.TTF s8514oem.fon vga860.fon
cambria.ttc GILSANUB.TTF s8514sys.fon vga861.fon
cambriaz.ttf GIL_____.TTF SCHLBKBI.TTF vga863.fon
Candarab.ttf GLECB.TTF SCHLBKB.TTF vga865.fon
Candarai.ttf GLSNECB.TTF SCHLBKI.TTF vga866.fon
Candarali.ttf GOTHICBI.TTF SCRIPTBL.TTF vga869.fon
Candaral.ttf GOTHICB.TTF script.fon vga932.fon
Candara.ttf GOTHICI.TTF segmdl2.ttf vga936.fon
Candaraz.ttf GOTHIC.TTF segoeprb.ttf vga949.fon
CASTELAR.TTF GOUDOSB.TTF segoepr.ttf vga950.fon
CENSCBK.TTF GOUDOSI.TTF segoescb.ttf vgaf1255.fon
CENTAUR.TTF GOUDOS.TTF segoesc.ttf vgaf1256.fon
CENTURY.TTF GOUDYSTO.TTF segoeuib.ttf vgaf1257.fon
cga40737.fon h8514fix.fon segoeuii.ttf vgaf874.fon
cga40850.fon h8514oem.fon segoeuil.ttf vgafixe.fon
cga40852.fon h8514sys.fon segoeuisl.ttf vgafix.fon
cga40857.fon HARLOWSI.TTF segoeui.ttf vgafixg.fon
cga40866.fon HARNGTON.TTF segoeuiz.ttf vgafixr.fon
cga40869.fon HATTEN.TTF seguibli.ttf vgafixt.fon
cga40woa.fon himalaya.ttf seguibl.ttf vgaoem.fon
cga80737.fon holomdl2.ttf seguiemj.ttf vgas1255.fon
cga80850.fon HTOWERTI.TTF seguihis.ttf vgas1256.fon
cga80852.fon HTOWERT.TTF seguili.ttf vgas1257.fon
cga80857.fon hvgafix.fon seguisbi.ttf vgas874.fon
cga80866.fon hvgasys.fon seguisb.ttf vgasyse.fon
cga80869.fon impact.ttf seguisli.ttf vgasys.fon
cga80woa.fon IMPRISHA.TTF seguisym.ttf vgasysg.fon
CHILLER.TTF INFROMAN.TTF sere1255.fon vgasysr.fon
COLONNA.TTF Inkfree.ttf sere1256.fon vgasyst.fon
comicbd.ttf ITCBLKAD.TTF sere1257.fon VINERITC.TTF
comici.ttf ITCEDSCR.TTF serf1255.fon VIVALDII.TTF
comic.ttf ITCKRIST.TTF serf1256.fon VLADIMIR.TTF
comicz.ttf j8514fix.fon serf1257.fon webdings.ttf
consolab.ttf j8514oem.fon serifee.fon wingding.ttf
consolai.ttf j8514sys.fon serife.fon WINGDNG2.TTF
consola.ttf javatext.ttf serifeg.fon WINGDNG3.TTF
consolaz.ttf JOKERMAN.TTF serifer.fon YuGothB.ttc
constanb.ttf jsmalle.fon serifet.fon YuGothL.ttc
constani.ttf jsmallf.fon seriffe.fon YuGothM.ttc
constan.ttf JUICE___.TTF seriff.fon YuGothR.ttc
constanz.ttf jvgafix.fon seriffg.fon 方正粗黑宋简体.ttf
COOPBL.TTF jvgasys.fon seriffr.fon
[root@localhost yum.repos.d]# docker cp /root/Fonts/ 6dff945ac83d:/usr/share/fonts/truetype/custom
[root@localhost yum.repos.d]# ^C
[root@localhost yum.repos.d]# docker exec -it 6dff945ac83d /bin/bash
root@6dff945ac83d:/# fc-cache -fv
/usr/share/fonts: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/truetype: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/truetype/custom: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/truetype/custom/Fonts: caching, new cache contents: 1030 fonts, 0 dirs
/usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs
/root/.local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/usr/share/fonts/truetype: skipping, looped directory detected
/usr/share/fonts/truetype/custom: skipping, looped directory detected
/usr/share/fonts/truetype/custom/Fonts: skipping, looped directory detected
/var/cache/fontconfig: cleaning cache directory
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
root@6dff945ac83d:/# /usr/bin/documentserver-generate-allfonts.sh
Generating AllFonts.js, please wait...Done
Generating presentation themes, please wait...Done
ds:docservice: stopped
ds:docservice: started
ds:converter: stopped
ds:converter: started
root@6dff945ac83d:/# supervisorctl restart all
ds:docservice: stopped
ds:converter: stopped
ds:spellchecker: stopped
ds:example: stopped
ds:metrics: stopped
ds:docservice: started
ds:converter: started
ds:spellchecker: started
ds:metrics: started
ds:example: started
字体下拉菜单显示中文名称
下载FontCreator 4.1版。打开字体后,选择格式->命名
先选择英文 - 美国,可以看到字体名称显示的是英文名称:
然后选择中文 - 中国,可以看到字体名称显示的是中文的unicode编码,只是没有u而已。例如宋体的unicode编码就是\u5B8B\u4F53。
现在只需要将\5B8B\4F53复制到英文 - 美国中,替换SimSun即可。
最后保存字体:
重复上面安装字体的步骤即可。