From msdn: http://technet.microsoft.com/zh-cn/library/cc288637.aspx
Windows SharePoint Services 3.0 supports both host-based and Path-based website sets. The website set named after the host provides a scalable HOST solution. Each website set has a different host name. This means that the website set named after the host has a single host name URL. By deploying a website set named after the host, you can map wins or DNS entries to the website set in the Web application.
The path-based website set provides an enterprise HOST solution. Each web application has a different host name. In Path-based deployment, the website set is mapped to the management path under the web application. The path-based website set and the website set named after the host can be stored in the same web application, and the Web application can contain thousands of website sets.
The path-based website set supports Alternate access ing between multiple regions. Each region can have different wins ing or dns url ing URLs.
About the website set named after the host
The website set named after the host allows Windows SharePoint Services 3.0 to use the host header name (rather than the path) to determine the website set accessed by the user and the content returned by the response to the user request. By creating a website set named after a host, you can host multiple website sets with empty URLs. If the Windows SharePoint Services 3.0 content database is associated with the Windows SharePoint Services 3.0 search instance, Windows SharePoint Services 3.0 automatically attempts to crawl the newly created website set named after the host.
For information about configuring website sets named after hosts for form authentication, see preparing to crawl websites named after hosts for form authentication.
For information about configuring the website set named after the host to use basic authentication, see preparing to crawl the website named after the host to use basic authentication.
You can create multiple root-level website sets in a web application using the website set named after the host. For example, the administrator of the host organization creates multiple websites named by domain using the website set named by host. Windows SharePoint Services 3.0 allows you to have multiple domains in a web application. In Windows SharePoint Services 2.0, this is called "scalable host mode ". Scalable host mode allows you to place multiple domains (such as http://www.adatum.com, http://www.contoso.com, and so on) as a separate site set in the same web application. In Windows SharePoint Services 3.0, website sets named after hosts provide the same scalable host function.
If you need to support a path-based website set to respond to multiple host name URLs, consider using the alternate access ing instead of the website set named after the host. For more information about alternate access mappings, see planning alternative access mappings (Windows SharePoint Services ).
You can place a website set named after a host on multiple web applications. You can use Windows SharePoint Services 3.0 to expand multiple IIS websites. A website set named after a host supports portals.
Create a website set named after the host
You can use the stsadm.exe command line tool to create a new website. You cannot use the Windows SharePoint Services 3.0 management center web application to create a website set named after the host.
Use the stsadm.exe createsite command to create a website set and add the following parameters to this operation to indicate that the website set should be named by the host rather than by path:
Copy code
-hhurl <Web application URL>
For example, if you have a web application named www.contoso.com and you want to add a host-named website set with a URL as a http://hoster.contoso.com, run the following command:
Copy code
stsadm.exe -o createsite
-url http://hoster.contoso.com
-ownerlogin contoso\siteowner
-owneremail siteowner@contoso.com
-hhurl http://www.contoso.com
The Internet Service Provider (ISP) configures its DNS server to associate the http://hoster.contoso.com with the corresponding IP address. For testing, you can edit the \ system32 \ drivers \ etc \ hosts file to associate the website set named after the host with the IP address of the server running Windows SharePoint Services 3.0. After configuring this option, you can browse to the http://hoster.example.com to access your website.
If you want to change the URL of a website set after creating a website set named after the host, run the following command:
Copy code
stsadm.exe -o renamesite
Windows SharePoint Services 3.0 patch provides this command. For details about how to use the stsadm.exe-O renamesite command, see renamesite: stsadm operation (Windows SharePoint Services ).
When creating a configuration database, you do not need to specify whether to use a website set named after the host. When creating a website set, you can specify whether the website set is named after the host or based on the path.
In addition to using the command line tool to create a website named after a host, you can also use the Windows SharePoint Services 3.0 object model. The following sample code creates a http://hoster.contoso.com for the same website:
Copy code
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);
Application Host Header
You can apply host headers at two different levels:
In most cases, when the web application-level application Host header is used, the website set named after the host cannot be accessed, this is because IIS does not respond to requests with different host names than those set in IIS. However, if you configure the IIS website in the default region to have no host header and only apply the Host header to the IIS website in other regions, you can access the website set named after the host. In this way, you can use the default region with the Host Name (these website sets are considered to be in the default region, this allows you to use the alternate access ing feature for path-based website sets in other regions.
Application host headers at the web application (IIS website) level:
-
On the Management Center homepage, click Application Management ".
-
In the SharePoint Web Application Management Section on the Application Management page, click create or expand web application ".
-
In the Add SharePoint Web Application Section on the create or expand web application page, click New web application ".
-
On the "Create web application" page, in the "IIS website" section, configure the Host header of the new web application, in the Host Header box, type a URL to access the Web application.
Host header value specifies the binding to be created for the IIS website, and ensure that IIS only responds to the request sent to the specified host header. You can manually modify IIS binding from the IIS manager, but it is not recommended to do so. Any changes made using IIS manager will not affect Windows SharePoint Services 3.0. If Windows SharePoint Services 3.0 tries to set up an IIS website on another computer in the server farm of the same web application and region, the binding specified on the new Web application page is used. If you want to modify the existing binding of the ISS website, remove the web application from the region and re-extend the web application to the region through the binding to be used.
Configure the website set named after the host
Windows SharePoint Services 3.0 provides a set of web services for a variety of users and management tasks. One of the management tasks is to create a new website, but the createsite web method does not support creating a website set named after the host. The solution to this problem is to compile a web service to encapsulate the API sample code.
When setting a new Windows SharePoint Services 3.0 website, you must consider multiple other configuration options. Specifying the corresponding website template during website creation determines which pre-configured web parts and other user interface elements can be provided for the new website. In the host solution, you may need to select a workgroup website template ("STS #0" value when creating a website) or empty websites that do not contain Web parts or pre-fabricated lists ("STS #1" value ).
In the host environment, consider specifying the website quota on each newly set Windows SharePoint Services 3.0 website. Although the sample Web service does not support website quota templates, you can add website quotas and use them to create website quota templates based on predefined limits.
Use SQL to create a website set named after the host
When using the SQL membership provider in the host solution, additional steps are required to correctly configure and manage the website set named after the host. When creating any website, you must specify the user who will become the website owner. This means that the owner already exists as a user in the Membership Directory. To simplify this operation and other SQL membership provider tasks, use the membershipsiteadmin.exe tool.
Note: |
For information about downloading the membershipsiteadmin.exe tool, see SharePoint SQL website providers sample source code http://www.codeplex.com/SharePointHosters/Release/ProjectReleases.aspx? Releaseid = 5097 |
Membershipsiteadmin.exe is a command line tool used to manage how to create and delete websites and users, and how to map websites and users to applications that help with the following tasks:
-
Create a user in the SQL membership database.
-
Delete users in the SQL membership database.
-
Create a Windows SharePoint Services 3.0 web site.
-
Delete the Windows SharePoint Services 3.0 website.
-
Enumerate all applications associated with the specified user, or check whether a user exists in the system or any other application.
Stsadm.exe executes the process of creating or deleting a Windows SharePoint Services 3.0 website. Stsadm.exe must have an available configuration file. Membershipsiteadmin.exe calls the custom stored procedure and membership provider API, and encapsulates the stsadm.exe tool. Membershipsiteadmin.exe maps the application name to the fully qualified domain name (FQDN) of the Windows SharePoint Services 3.0 website by calling one of the following custom stored procedures ):
You can use the ASP. NET membership Service API (system. Web. Security. Membership) to create and delete users in the SQL membership library. Membershipsiteadmin.exe can call the membership. createuser method or the membership. deleteuser method to complete this process. The provider used by the membership service is specified in the app. config file (membershipsiteadmin.exe. config) of membershipsiteadmin.exe. Membershipsiteadmin.exe uses the transfer SQL membership provider to execute these tasks and specifies the name of the application to be connected to the user. The membershipsiteadmin.exe. config file should point to the default location of the stsadm.exe file. If Windows SharePoint Services 3.0 is installed in another location, you need to update the application settings. See the following section of the membershipsiteadmin.exe. config file:
Copy code
<appSettings>
<add key="stsadmPath"
value="C:\Program Files\Common Files\Microsoft Shared\Web server
extensions\12\BIN\" />
</appSettings>
Publish websites named after hosts through HTTP and https
If you create a website set named after the host on the default port, you can publish these website sets through HTTP and HTTPS protocols. If you create a website set on any other port, each website set named after the host can only be HTTP or HTTPS, depending on the URL entered for the-URL parameter of the createsite command. The website set named after the host cannot be used together with the advanced exclusive Scheme (such as SSL termination) provided by the standby access ing.
You can use these two protocols to obtain search results by creating a web application using HTTP and a web application using HTTPS. Search for the Protocol scheme of the Public URL that will be assigned to the default region of the Web application to determine the type of Protocol scheme used by the website set named by the host. If you want to search for a website set named after a host through HTTP, place it in an HTTP web application. If you want to search for a website set named after the host through https, place it in an HTTPS web application.
Configure https for the website set named after the host
Before configuring https, you must apply a certificate to the IIS website. Therefore, in Windows SharePoint Services 3.0, you can only configure HTTPS at the web application level. In the host solution, the host hosting service provider can configure a single web application through https, and then create multiple website sets named after the host in the Web application. Technically, each website shares the same certificate. The host hosting service provider needs to obtain a wildcard certificate, and then uses the URL policy of the website set named after the host that matches the wildcard certificate. For example, if a host hosting service provider receives a * .contoso.com wildcard certificate, the host hosting service provider must generate a host-named website set URL (such as a https://site1.contoso.com, https://site2.contoso.com, etc ), to make these websites pass SSL authentication in the browser. However, if you require a unique certificate for each website application, the host hosting service provider must create multiple web applications. The scalability of Web applications is not as good as the website set in Windows SharePoint Services 3.0.
To configure https for a website set named after a host, you must enable SSL on the "new web application" page of the management center. Windows SharePoint Services 3.0 automatically assigns a port number to the web application, but you can manually specify another port number.
You can create an HTTPS website for Account creation mode, Active Directory (domain account mode), and Active Directory form authentication.
After creating a web application, open the IIS manager and assign a certificate. Create a website set and ensure that the port number is specified for the-URL and-hhurl parameters of the stsadm.exe-O createsite command when non-default ports are used, as shown in the following example:
Copy code
stsadm.exe –o createsite
–ownerlogin contoso\administrator
–owneremail administrator@contoso.com
–url https://www.hoster.contoso.com:443
–hhurl https://www.contoso.com:443