.NET_STAR

打造技术团队,愿与您共同开创事业!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

摘自(Microsoft MSDN):

 

以主机命名的网站集允许 Windows SharePoint Services 3.0 使用主机头名称(而不是路径),来确定用户访问的网站集以及对用户请求的响应所返回的内容。通过创建以主机命名的网站集,您可以为用户承载具有空 URL 的多个网站集。如果 Windows SharePoint Services 3.0 内容数据库与 Windows SharePoint Services 3.0 搜索实例相关联,则 Windows SharePoint Services 3.0 会自动尝试对新创建的以主机命名的网站集进行爬网。

有关配置使用表单身份验证的以主机命名的网站集的信息,请参阅准备对使用表单身份验证的以主机命名的网站进行爬网

有关配置使用基本身份验证的以主机命名的网站集的信息,请参阅准备对使用基本身份验证的以主机命名的网站进行爬网

通过以主机命名的网站集,您可以在 Web 应用程序中创建多个根级别的网站集。例如,宿主组织的管理员使用以主机命名的网站集创建多个以域命名的网站。利用 Windows SharePoint Services 3.0,您可以在一个 Web 应用程序中具有多个域。在 Windows SharePoint Services 2.0 中,这称为“可伸缩宿主模式”。可伸缩宿主模式支持将多个域(如 http://www.adatum.com、http://www.contoso.com 等)作为单独的网站集放置在同一 Web 应用程序中。在 Windows SharePoint Services 3.0 中,以主机命名的网站集提供相同的可伸缩宿主功能。

如果需要支持基于路径的网站集响应多个主机名 URL,请考虑使用备用访问映射,而不是以主机命名的网站集。有关备用访问映射的详细信息,请参阅规划备用访问映射 (Windows SharePoint Services)

可以将以主机命名的网站集放置在多个 Web 应用程序上。可使用 Windows SharePoint Services 3.0 扩展多个 IIS 网站。以主机命名的网站集支持门户网站。

创建以主机命名的网站集

可以使用 stsadm.exe 命令行工具创建新网站。不能使用 Windows SharePoint Services 3.0 管理中心 Web 应用程序创建以主机命名的网站集。

使用 stsadm.exe createsite 命令创建网站集,并将以下参数添加到该操作,以指示该网站集应该是以主机命名的,而不是基于路径:

-hhurl <Web application URL>

例如,如果有一个名为 www.contoso.com 的 Web 应用程序,并且要添加 URL 为 http://hoster.contoso.com 的以主机命名的网站集,请使用以下命令:

stsadm.exe -o createsite
-url http://hoster.contoso.com
-ownerlogin contoso\siteowner
-owneremail siteowner@contoso.com
-hhurl http://www.contoso.com

Internet 服务提供商 (ISP) 配置其 DNS 服务器,使 http://hoster.contoso.com 与相应的 IP 地址相关联。为进行测试,您可以编辑 \system32\drivers\etc\hosts 文件以使以主机命名的网站集与运行 Windows SharePoint Services 3.0 的服务器的 IP 地址相关联。配置完此项时,您可以浏览到 http://hoster.example.com 以访问您的网站。

如果要在创建以主机命名的网站集后更改该网站集的 URL,请使用以下命令:

stsadm.exe -o renamesite

Windows SharePoint Services 3.0 修补程序中提供此命令。有关使用 stsadm.exe -o renamesite 命令的详细信息,请参阅 Renamesite:Stsadm 操作 (Windows SharePoint Services)

在创建配置数据库时,不需要指定是否要使用以主机命名的网站集。可以在创建网站集时,指定网站集是以主机命名还是基于路径。

除使用命令行工具创建以主机命名的网站外,还可以使用 Windows SharePoint Services 3.0 对象模型。下面的代码示例创建同一网站 http://hoster.contoso.com:

SPWebApplication webApp = SPWebApplication.Lookup(new
Uri("http://www.contoso.com"));
SPSiteCollection sites = webApp.Sites;
SPSite Site = null;
Site = sites.Add("http://hoster.contoso.com", "Site_Title",
"Site_Description", 1033, "STS#0", "contoso\owner",
"Owner_Display_Name", "Owner_Email", "contoso\secondaryowner,
"Secondary_Owner_Display_Name", "Secondary_Owner_Email", true);

 

posted on 2010-04-27 15:16  雷明  阅读(284)  评论(0编辑  收藏  举报