office web apps Preview Online Q & A

In a recent project to do, need to use online document preview, read the article Ming of a build office web apps and services, but because of time, without careful study, these days have the time, I took out a study under, toss a few days finally completed the deployment, and then lived in to do the next record.

advantage

  • Existing code changes very small, almost negligible.
  • Without having to write their own code, only one server can
  • It supports very comprehensive document type, doc, ppt, xls, docx, pptx, xlsx, pdf.
  • Mobile phones and pc support, support document caching, tabbed browsing.

First, the server environment requirements

Server: two servers, one for the conversion server, another one for the domain controller server. (Installation of office web apps domain servers must be added in order to install successfully, if there is no step back will add a domain error occurs, the difficult problems which will be introduced)

System Requirements: Conversion Server using the Window Server 2008 R2 64bit SP1 or above, NET Framework 4.5, KB2592525, Windows PowerShell 3.0, IIS, ensure 80443809 port is not being used, make sure the current machine is not installed office, make sure the current machine is not installed Exchange, sharepoint, lync server, sql server

Explanation: The server bandwidth and memory as high as possible, tests found more consumption of performance, was the reason I start from the principle of service implementation. office web apps and services will be provided by the user src documents, the documents downloaded from the server src, followed by conversion, according to the document name cache, return after the conversion is complete. The larger the temporal bandwidth of the download process using the shorter, the better the performance of the server faster conversion.

  

Second, software download

This article steps required to install the software I have on Baidu cloud disk, and can be downloaded. Download: http://pan.baidu.com/s/1hrBeYqw

Third, the domain controller server deployment

Please my other article: "Domain Controller Server Installation Guide" to complete the deployment.

Fourth, the conversion server deployment

The operation uses a Windows Server 2008 r2 operating system.

Note: Please be conducted in strict accordance with the following order, otherwise problems may occur, it is difficult to solve! If you encounter a need to restart, to continue operating after the restart.

1, install .NET Framework4.5.

2, the installation IIS7.

1) Open Server Manager, add roles, select the Web server, click Next, add the required functionality.

 

2) Check the "Application Development" feature, other defaults, click Next.

 

3) install the patch.

  Windows Server 2008 R2 x64 Edition update (KB2592525) _Windows6.1-KB2592525-x64.msu

 

4) Installation powershell.

  Windows6.1-KB2506143-x64.msu

 

5) install the ink support.

Open Server Manager, add features, add ink and handwriting support services below the ink.

 

6) Installation office web apps.

Open the downloaded file wacserver.exe double-click to install.

 

Check accept the terms, click Continue.

 

The default file location, click Install Now.

 

Wait for the installation to complete!

7) install language packs.

wacserverlanguagepack.exe

 

8) Installation office web apps sp1 patch

wacserversp2013-kb2880558-fullfile-x64-glb.exe

 

9) Configure Office web apps via PowerShell

Note that this step is carried out when you want to log off the computer, use a domain account login.

Right administrators run PowerShell

 

Start office server farm, enter the following command.

Import-Module OfficeWebApps

Office server farm deployment, enter the following command (which parameters need to be modified according to your own server).

New-OfficeWebAppsFarm -InternalURL http://xx.domin.com  -ExternalURL http://xx.domin.com  -AllowHttp -EditingEnabled -OpenFromUrlEnabled

office services field parameters:

Use New-OfficeWebAppsFarm meaning and the parameters can go to Microsoft's official website View: http://technet.microsoft.com/zh-cn/library/jj219436.aspx

-InternalURL:内网浏览地址,http://xx.domin.com 其中 xx表示计算机名 domin.com 表示域名

-ExternalURL:外网浏览地址,一般为服务器的IP地址

-AllowHttp 允许80端口访问

-OpenFromUrlEnabled 允许通过url方式进行预览

-CacheLocation  缓存文件存放路径 默认是C:\ProgramData\Microsoft\OfficeWebApps\Working\d 

-CacheSizeInGB  最大缓存文件大小 单位GB 默认为15GB

关于-InternalURL的怎么设置,可以计算机右键-》属性进行查看  计算机全名则是需要的地址

 

执行完命令就可以在iis中查看了,可以看到自动添加了两个站点,通过上面的地址http://xx.domin.com 进行浏览,出现下面的界面则表示整个安装完成了。

可以通过 http://xx.domin.com/hosting/discovery 查看描述。

当然,通过IP也是可以访问的 http://ip地址/hosting/discovery。

使用过程中如果想修改服务配置,可以通过Set-OfficeWebAppsFarm命令进行修改

Set-OfficeWebAppsFarm -AllowHttp

使用以下地址预览文档

  1.  
    //注意,文档地址需要外网能访问到
  2.  
    http://xx.domin.com/op/embed.aspx/src=http://www.baidu.com/test.docx

五、疑难问题解决

1、New-OfficeWebAppsFarm : 登录失败: 未知的用户名或错误密码

  1.  
    PS C:\Users\Administrator> New-OfficeWebAppsFarm -InternalURL "http://xxxx" -AllowHttp -EditingEnabled
  2.  
    New-OfficeWebAppsFarm : 登录失败: 未知的用户名或错误密码。
  3.  
    所在位置 行: 1 字符: 1
  4.  
    + New-OfficeWebAppsFarm -InternalURL "http://xxxx" -AllowHttp -EditingE ...
  5.  
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6.  
    + CategoryInfo : NotSpecified: (:) [ New-OfficeWebAppsFarm], AuthenticationException
  7.  
    + FullyQualifiedErrorId : System.Security.Authentication.AuthenticationException,Microsoft.Office.Web.Apps.Adminis
  8.  
    tration.NewFarmCommand

遇到这种问题,可能是你在转换服务器没有注销用户,需要再转换服务器注销用户,切换使用域服务器的账户登陆!

2、HTTP 错误 500.21

  1.  
    HTTP 错误 500.21 - Internal Server Error
  2.  
    处理程序“DiscoveryService”在其模块列表中有一个错误模块“ManagedPipelineHandler”

出现这种错误是第一步安装的.net framework4.5未在iis中注册导致的。

以管理员方式打开cmd,运行以下命令

cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319 .\aspnet_regiis.exe -iru

出现如下提示即解决!

  1.  
    Microsoft (R) ASP.NET RegIIS 版本 4.0.30319.17929
  2.  
    用于在本地计算机上安装和卸载 ASP.NET 的管理实用工具。
  3.  
    版权所有(C)
  4.  
    Microsoft Corporation。
  5.  
    保留所有权利。
  6.  
     
  7.  
    开始安装 ASP.NET (4.0.30319.17929)。 .............
  8.  
    ASP.NET (4.0.30319.17929)安装完毕。
  9.  
    iisreset /restart /noforce
  10.  
    正在尝试停止...
  11.  
    Internet 服务已成功停止
  12.  
    正在尝试启动...
  13.  
    Internet 服务已成功启动

3、文件太大解决方案(>10M)

服务默认支持的最大文件大小是10M,大于10M会报错。可以通过以下步骤解决此问题 

打开文件目录为C:\Program Files\Microsoft Office Web Apps\OpenFromUrlHost 中的文件 Settings_Service.ini

在内容最后添加以下内容(512000/1024M,可以根据自己的需求设定、后面不要加分号)。

OpenFromUrlMaxFileSizeInKBytes=(System.Int32)512000

修改 C:\Program Files\Microsoft Office Web Apps\OpenFromUrlWeb 下的Settings_Service.ini,进行相同的修改

重启office web apps服务即可!

 

4、文档地址为ip时预览报错

比如文档地址为http://10.5.192.168/A.docx 这个时候预览会报错 ,而相应的地址为http://mydoc.com/A.docx 域名的则是好的。这个问题估计是微软自己的安全验证问题,这也算时微软留下来的一个坑,暂时没有想到解决方案。

Guess you like

Origin www.cnblogs.com/ruiy/p/11126611.html