1 基础知识
– Office Online Server是一款Office服务器产品
– Office Online Server为Office文件提供基于浏览器的文件查看和编辑服务
– Office Online Server可与支持WOPI(Web应用程序开方平台接口协议)的产品和服务集成
– Office Online Server支持横向扩展(即支持多台服务器同时服务)
– Office Online Server提供基于浏览器的Word、PowerPoint、Excel和OneNode服务
– Office Online Server支持SharePoint服务、Exchange服务、共享文件夹和网站访问Office文件的用户
2. 安装前的准备
2.1 准备服务器
OS = Windows Server 2019
IP = 10.168.0.19[4,5]
Host Name = officeSer0[1,2].cmdschool.org
OS = Windows 11
IP = any
Host Name = any
2.2 系统的基本配置
如有需要详细请参阅如下章节,
2.4 准备IIS证书
如有需要详细请参阅如下章节,
3 部署officeonline服务
In officeSer0[1-2],
3.1 安装软件包
3.1.1 在线安装软件包
Add-WindowsFeature Web-Server,Web-Mgmt-Tools,Web-Mgmt-Console,Web-WebServer,Web-Common-Http,Web-Default-Doc,Web-Static-Content,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Security,Web-Filtering,Web-Windows-Auth,Web-App-Dev,Web-Net-Ext45,Web-Asp-Net45,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Includes,NET-Framework-Features,NET-Framework-45-Features,NET-Framework-Core,NET-Framework-45-Core,NET-HTTP-Activation,NET-Non-HTTP-Activ,NET-WCF-HTTP-Activation45,Windows-Identity-Foundation,Server-Media-Foundation
3.1.2 下载软件包
cd ~ wget -Uri http://www.cmdschool.org/officeonline/MicrosoftIdentityExtensions-64.msi -OutFile MicrosoftIdentityExtensions-64.msi wget -Uri http://www.cmdschool.org/officeonline/NDP452-KB2901954-Web.exe -OutFile NDP452-KB2901954-Web.exe wget -Uri http://www.cmdschool.org/officeonline/SW_DVD5_Office_Professional_Plus_64Bit_ChnSimp_-6_OfficeOnlineSvr_MLF_X21-90447.ISO -OutFile SW_DVD5_Office_Professional_Plus_64Bit_ChnSimp_-6_OfficeOnlineSvr_MLF_X21-90447.ISO wget -Uri http://www.cmdschool.org/officeonline/vc_redist.x64.exe -OutFile vc_redist.x64.exe wget -Uri http://www.cmdschool.org/officeonline/vcredist_x64.exe -OutFile vcredist_x64.exe wget -Uri http://www.cmdschool.org/officeonline/wacserver2019-kb5002276-fullfile-x64-glb.exe -OutFile wacserver2019-kb5002276-fullfile-x64-glb.exe
以上是内部服务器的下载,如果没有准备请使用如下链接下载,
http://www.microsoft.com/zh-cn/download/details.aspx?id=42643
https://www.microsoft.com/en-us/download/details.aspx?id=40784
https://www.microsoft.com/en-us/download/details.aspx?id=48145
https://download.microsoft.com/download/0/1/D/01D06854-CA0C-46F1-ADBA-EBF86010DCC6/MicrosoftIdentityExtensions-64.msi
https://www.microsoft.com/en-us/download/details.aspx?id=104701
3.1.3 安装下载的软件包
.\MicrosoftIdentityExtensions-64.msi .\NDP452-KB2901954-Web.exe .\vcredist_x64.exe .\vc_redist.x64.exe
3.1.4 安装officeonline软件包和更新
Mount-DiskImage -ImagePath C:\Users\cmdschooladmin\SW_DVD5_Office_Professional_Plus_64Bit_ChnSimp_-6_OfficeOnlineSvr_MLF_X21-90447.ISO
光盘挂载后,我们列出挂载的设备,
Get-PSDrive
可见如下显示,
Name Used (GB) Free (GB) Provider Root CurrentLocation ---- --------- --------- -------- ---- --------------- Alias Alias C 15.00 74.40 FileSystem C:\ Users\cmdschooladmin Cert Certificate \ D FileSystem D:\ E 0.75 0.00 FileSystem E:\ Env Environment Function Function HKCU Registry HKEY_CURRENT_USER HKLM Registry HKEY_LOCAL_MACHINE Variable Variable WSMan WSMan
然后,切换到挂载的驱动器安装,
E: .\setup.exe
安装完成后,使用如下命令卸载光驱,
Dismount-DiskImage -ImagePath C:\Users\cmdschooladmin\SW_DVD5_Office_Professional_Plus_64Bit_ChnSimp_-6_OfficeOnlineSvr_MLF_X21-90447.ISO
安装更新包,
.\wacserver2019-kb5002276-fullfile-x64-glb.exe
安装完成后,你需要重启服务器是配置生效,
Restart-Computer
3.2 设置访问的URL
New-OfficeWebAppsFarm -InternalUrl "https://officeonline.cmdschool.org/" -ExternalUrl "https://officeonline.cmdschool.org/" -CertificateName "wildcard.cmdschool.org" -EditingEnabled -AllowHttp
配置完毕后,你可以使用如下命令查看服务状态,
Get-OfficeWebAppsFarm
如果需要清除所有配置重新配置,请使用如下命令,
Remove-OfficeWebAppsMachine
3.3 配置名称解析
In officeSer01 and Client,
notepad \Windows\System32\drivers\etc\hosts
加入如下配置,
10.168.0.194 officeonline.cmdschool.org 10.168.0.195 officeonline.cmdschool.org
需要注意的是,
– 以上用于测试环境测试,如果是生产环境请使用DNS配置名称解析。
– 以上两个解析测试时请同一时间只启用其中一个解析
3.4 配置集群
In officeSer02,
New-OfficeWebAppsMachine -MachineToJoin "officeSer01"
加入集群后,可以使用如下命令查询集群的状态,
In officeSer01,
Get-OfficeWebAppsMachine
页面显示如下,
MasterMachineName MachineName Roles HealthStatus ----------------- ----------- ----- ------------ officeSer01 officeSer01 {All} Healthy
服务状态,请使用如下命令,
Get-OfficeWebAppsFarm
可见如下显示,
#... Machines:{officeSer01,officeSer02}
In officeSer02,
Get-OfficeWebAppsMachine
页面显示如下,
MasterMachineName MachineName Roles HealthStatus ----------------- ----------- ----- ------------ officeSer01 officeSer02 {All} Healthy
3.5 测试服务配置
In Client,
根据实际的配置,我们使用以下链接测试,
https://officeonline.cmdschool.org/hosting/discovery
如果见到如下显示,即设置成功,
<wopi-discovery> <net-zone name="internal-http"> <app name="Excel" favIconUrl="http://officeonline.cmdschool.org/x/_layouts/resources/FavIcon_Excel.ico" bootstrapperUrl="http://officeonline.cmdschool.org/x/_layouts/app_scripts/excel-boot.min.js" checkLicense="true"> <action name="view" ext="csv" default="true" urlsrc="http://officeonline.cmdschool.org/x/_layouts/xlviewerinternal.aspx?<ui=UI_LLCC&><rs=DC_LLCC&><dchat=DISABLE_CHAT&><hid=HOST_SESSION_ID&><IsLicensedUser=BUSINESS_USER&><actnavid=ACTIVITY_NAVIGATION_ID&>"/> #...
然后,使用如下命令验证,
https://officeonline.cmdschool.org/op/generate.aspx
如上图所示,
填入文档地址链接“https://www.cctv.com/download/teleplayvip/smygdxyfjgg.doc”
单击【Create Link】
单击【Test this link】后可见如下显示,
3.6 服务的控制
3.6.1 查询Office Online服务状态
Get-Service wacsm
3.6.2 停止Office Online服务
Stop-service wacsm
3.6.3 启动Office Online服务
Start-Service wacsm
3.6.4 重启Office Online服务
Restart-service wacsm
3.7 故障排查
3.7.1 查询服务日志
cd C:\ProgramData\Microsoft\OfficeWebApps\Data\Logs\ULS Get-Content -Tail 10 -Wait OFFICEONLINE-20221206-1627.log
3.7.2 清理服务缓存
cd C:\ProgramData\Microsoft\OfficeWebApps\Working\d del * dir
没有评论