Showing posts with label Host Header. Show all posts
Showing posts with label Host Header. Show all posts

Tuesday, 9 December 2014

Making a SharePoint 2010 site externally available (Alternate Access Mappings, Host Header Bindings)


Scenario:How to make a SharePoint 2010 site externally available? Explanation:This is a very fundamental scenario that many SharePoint developers may encounter in the SharePoint world. A SharePoint site can be made externally available by following the steps below:
Point the desired host name (i.e. portal.sitename.com for example) to the public ip address of the SharePoint server (may it be the ip of the server in a single server farm or the load balancer in a multi server farm). Typically the network administrator does this.
Once that has been set, all the requests for http://portal.sitename.com will be directed to the specified SharePoint Server. But the SharePoint server needs to know which site to serve for such requests. Therefore we need to configure host name bindings in IIS.
Open up IIS Manager and select the desired sharepoint site and choose "Edit Bindings"

http://chaitumadala.typepad.com/.a/6a011278f8726328a40133f00ecdb5970b-pi

In the resulting screen, click edit



http://chaitumadala.typepad.com/.a/6a011278f8726328a40133f00ef113970b-pi

Next, provide the host name (portal.sitename.com in this case) 

 http://chaitumadala.typepad.com/.a/6a011278f8726328a401348337cafd970c-pi


 Now its time to configure Alternate Access Mappings in SharePoint. Go to Central Admin > Application Management > Alternate Access Mappings.

 http://chaitumadala.typepad.com/.a/6a011278f8726328a40133f00f153b970b-pi

 Click on "Edit Public URLs" and then choose the appropriate Alternate Access Mapping Collection.

 http://chaitumadala.typepad.com/.a/6a011278f8726328a40133f00f23df970b-pi

All looks fine now. At this point, if you create a new site collection and try to access the host (http://portal.sitename.com) from a different machine than the server, it works. But if you try to access the host from within the server, you may get a 404 page not found error.
While we are aware of the problems that SharePoint can encounter related to the Windows Server loopback check issue and host headers, I just wanted to reiterate that while it is OK to outright disable the check in dev/qa environments, we should instead be specifying a list of acceptable host names in the registry for production environments.
Completely disabling the check is a security hole that would likely be picked up should one of our production environments be audited.
Both techniques for handling the Loopback check issue are covered in this KB article: http://support.microsoft.com/kb/896861
Thanks to our Practice Lead David Perkinson for helping me resolve this issue.
Specify host names (Preferred method if NTLM authentication is desired)To specify the host names that are mapped to the loopback address and can connect to Web sites on your computer, follow these steps:
  1. Set the DisableStrictNameChecking registry entry to 1. For more information about how to do this, click the following article number to view the article in the Microsoft Knowledge Base: 281308 (http://support.microsoft.com/kb/281308/ ) Connecting to SMB share on a Windows 2000-based computer or a Windows Server 2003-based computer may not work with an alias name
  2. Click Start, click Run, type regedit, and then click OK.
  3. In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
  4. Right-click MSV1_0, point to New, and then click Multi-String Value.
  5. Type BackConnectionHostNames, and then press ENTER.
  6. Right-click BackConnectionHostNames, and then click Modify.
  7. In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.
  8. Quit Registry Editor, and then restart the IISAdmin service.
Now we should be able to access the site using the host name both internally as well as externally.


Reference:

http://underthehood.ironworks.com/2010/06/making-a-sharepoint-2010-site-externally-available-alternate-access-mappings-host-header-bindings.html

Changing the DNS or URL (host header) in SharePoint 2007 Site

Basic Details:
For changing the host header (and more), check out Alternate Access Mappings.  You will find this under the Operations tab and Global Configuration section.  Click "Edit Public URLs" and be sure to have the correct web application selected before you make any changes.

Scenario:If you have developed the sharepoint site with url
http://xyz:47089 and xyz is machine name and later you have mapped with any public IP then you will be able  to access only home page but you can not access other resources and page that is bindup with all links available in site. In this case, you can change URL by Alternate access mappings.

Solution:

Step[1]: Open Sharepoint Central Admin & go to Operations tab

CentralAdmin.JPG

Step[2]: Under Global configuration heading select Alternate access mappings.

GlobalConfiguration.JPG

Step[3]: Select the desired web application i.e. http://xyz:47089 (in this example)

EditPublicURL.JPG




Step[4]: On Edit Internal URLs page set the change the value of http://xyz1:47089 to http://155.23.84.70:47089.

Alternate.JPG

Step[5]: Now this site[http://155.23.84.70:47089] will be accessible throughout the intranet from any domain.
Note: The same you can map with Public IP for e.g. 155.23.84.70 and you just need to  provide windows authetication to this site.
Basic Details:
For changing the host header (and more), check out Alternate Access Mappings.  You will find this under the Operations tab and Global Configuration section.  Click "Edit Public URLs" and be sure to have the correct web application selected before you make any changes.

Scenario:If you have developed the sharepoint site with url
http://xyz:47089 and xyz is machine name and later you have mapped with any public IP then you will be able  to access only home page but you can not access other resources and page that is bindup with all links available in site. In this case, you can change URL by Alternate access mappings.

Solution:

Step[1]: Open Sharepoint Central Admin & go to Operations tab

CentralAdmin.JPG

Step[2]: Under Global configuration heading select Alternate access mappings.

GlobalConfiguration.JPG

Step[3]: Select the desired web application i.e. http://xyz:47089 (in this example)

EditPublicURL.JPG




Step[4]: On Edit Internal URLs page set the change the value of http://xyz1:47089 to http://155.23.84.70:47089.

Alternate.JPG

Step[5]: Now this site[http://155.23.84.70:47089] will be accessible throughout the intranet from any domain.
Note: The same you can map with Public IP for e.g. 155.23.84.70 and you just need to  provide windows authetication to this site.


Reference:

http://www.c-sharpcorner.com/uploadfile/rifaqats/changing-the-dns-or-url-host-header-in-sharepoint-2007-site/

Saturday, 29 November 2014

SharePoint 2010 - Creating Host Name For Web Application


In this article we can explore how to quickly setup a Host Name for the SharePoint Web Application.

Why we need Host Names?
I hope some of you are wondering why we need a host name. I will try to explain the purpose.

You have the following website for a user:

http://servername:67655
http://servername:88813
http://servername:12345

Let us say that each of them represents the following:

  • Financial Site
  • HR Site
  • Research Site
The problem is the difficulty in using those URLs since there is no meaning associated with them. A better solution would be:

http://finance.corp.com
http://hr.corp.com
http://research.corp.com

So this neat and clean approach requires configuring Host Headers for the SharePoint web applications. The host header configured will be passed in the HTTP header message. The host header has to be published inside a DNS server to get it resolved to an IP and port.

The approach used here can be used across Windows 7 and Windows 2008 machines. Please note that you can even configure host names with site collections too.

Our Aim

We are trying to create a web application with the following name:

http://myapp.server.net

The following are the steps involved:

Step 1: Create the Host Name

Open the hosts file from the following location:

C:\Windows\System32\drivers\etc

Enter the following line into it and save the file:

127.0.0.1 myapp.server.net

Now the file content looks like:

HstShr1.jpg

Step 2: Create Web Application

Open the SharePoint Central Administration and create a new web application.

HstShr2.jpg

Please note to set the following properties:

Port: 80
Host Header: myapp.server.net

The properties are highlighted below:

HstShr3.jpg

After entering all the details click the Save button. Wait for the operation to be completed and you can try entering the URL in the browser.

http://myapp.server.net

Step 3: Disable Loopback

If you get a prompt for the user and you may face the following issues:

  • There is continuous prompt for the credentials
  • HTTP 401.1 error
This shows that there is a problem with the Loopback configuration. This situation should occur only when we access the application from the server machine.

For fixing the problem we have to disable the Loopback value inside the registry.

Open the Registry Editor (regedit.exe) and locate the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

Create a new Key Value of type DWORD inside it and set the value to 1:

HstShr4.jpg

Step 4: Test the Host Name

Now you can try entering the host name in the browser and you should be able to access the site after entering credentials.

HstShr5.jpg

If you can see the site as shown above then you are done with the Host Header configuration.

References
Understanding Host Headers
Loopback Information

Summary

In this article we have explored how to quickly setup a Host Name for the SharePoint Web Application. In real-world scenarios the SharePoint Administrator must work with the Network Administrators to configure these entries.


Reference:

http://www.c-sharpcorner.com/UploadFile/40e97e/sharepoint-2010-creating-host-name-for-web-application/

Create a Web Application With Host Header in SharePoint 2010


In this article we will learn how to create a web application with host header in SharePoint 2010. First we need to know what a host header is.

Host Header: Host header is nothing but providing a related name as the URL for the web application, by default SharePoint takes only the local server name as a URL and then render the data's from the content DB.

Here my server name is App1, so SharePoint takes only my local server name as the URL.

http://App1:222

We are trying to create a web application with the following name:

http://heureuxtech:222

So the following is the procedure for creating a web application with host header.

Step 1
Create a web application using Central Administration:

create a new web application

Here I specified the host header as heureuxtech and created one web application, you can see in the following picture, the URL created based on the host header.

host information

Step 2
Create the root site for the web application and run that URL, it will get the following error:

error

Step 3
Go to C:\Windows\System32\drivers\etc\host to register your host header, open the host file and type as given below:

host file

Step 4
Open regedit to disable the loopback, go to Run from the Start menu and type "regedit" and use the following path:

registry editor

Step 5
Create a new Key Value of type DWORD and name it DisableLoopBackCheck:

DWORD Value

Step 6
Right-click that DisableLoopBackCheck and click modify and set the value to 1 to enable it.

edit DWORD

Step 7
Open a browser and paste in the URL in the address bar and hit Enter and wait for the following screen:

web application with host header



Reference:

http://www.c-sharpcorner.com/UploadFile/82956c/create-a-web-application-with-host-header-in-sharepoint-2010/


Sunday, 23 November 2014

How to properly change the Host Header URL of a web application in SharePoint 2010

Fully configure host header for Web application (Step-by-Step)


Host header (aka domain names or host names) lets you assign more than one site to a single IP address on a web application hosted in the IIS Web server. In SharePoint, you may need specific name for your website e.g. http://thuansoldier.net/ instead of an ugly URL like http://thuansoldier:32431. Having a friendly URL probably makes your end-users much easier to access SharePoint. They don’t have to remember the port number
In this article, I’m going to show you how to configure Host Header in SharePoint through DNS configuration and IIS. You can also use PowerShell script I’ve written here.
Create new Web application
Open Central Administration > Application Management > Manage web applications (under Web Applications). Click New in Ribbon.
Select Classic Mode Authentication by default but you can go with claims-based authentication to leverage tons of capabilities from it. Under Name, type the name of the new Web application.  Use default port 80 as it will be used through HTTP. You can select another port but make sure it doesn’t conflict with any common port (e.g. 21..). Under Host Header, type the full domain of the web application you are going to use.
At Security Configuration settings, keep all by default all.
Use existing application pool (optional) Under Database Name at the Database Name and Authentication, remove GUID and keep the name of content database as simple as possible.
Select service application connection if you have and then click OK to create new Web application.
Register the host header in DNS Server
In DNS server, create new host A by click New Host (A or AAA)
Type host name under Name, and the SharePoint server’s IP address. Click Add Host.
Configure host header for a Web application
In IIS Manager, right click the Web application you need to assign host header to and then click Edit Binding. In Site Bindings dialog box, click Edit. At IP address option, select IP address of the SharePoint server. Under Host name, type your host name. Click OK.
Open Central Administration > Application Management, under Web Applications , click Configure alternate access mappings. Verify that the URL for the default zone is set correctly.
However, when you open portal.ict24h.net whether in Internet Explore 8 or Mozilla Firefox 3.5, you will encounter 404 Page Not Found error. What’s up? Yes, you haven’t created Site collection in your Web application yet.
At Central Administration, click Application Management > Create site collections (under Site Collections). Please notice your Web application that you have just created namely portal.ict24h.net.
Finally, check your website with the friendly URL
I want to share basics in this post because I saw some questions about it in SharePoint 2010 – Setup, Upgrade, Administration and Operation.
I hope this post helps everyone.

Reference:

http://thuansoldier.net/?p=1323