I have a deployed web application on my local IIS (7.0) and is working perfectly. Since it's on my local, it is accessible via http://<>/webapp/index.aspx. Now, what I am trying to achieve is to access it on a custom url i.e. http://www.someuniqueweburl.com, and will make sure that it doesn't exist on the internet and of course, can only be accessed when you are on the same network with the local IIS web server. Is this achievable?
Thanks a bunch!
You need some kind of DNS service to achieve this.
You may :
register a DNS entry in your local network DNS Server, if you have one. Then all your network should be able to sample.custom.url.com to your IP address
or add an entry line to your %windir%\System32\drivers\etc\hosts file :
127.0.0.1 sample.custom.url.com
but you will be the only one able to resolve sample.custom.url.com . Other machines will need a similar entry in their hosts file (with your network ip address, instead of 127.0.0.1)
Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
In the Connections pane, expand the Sites node in the tree, and then select the site for which you want to configure a host header.
In the Actions pane, click Bindings.
In the Site Bindings dialog box, select the binding for which you want to add a host header and then click Edit or click Add to add a new binding with a host header.
In the Host name box, type a host header for the site, such as www.contoso.com.
Click OK.
To add an additional host header, create a new binding with the same IP address and port, and the new host header. Repeat for each host header that you want to use this IP address and port.
I got this from the Microsoft technet website: Configure a Host Header for a Web Site (IIS 7)
Related
Right now, i have my default website in my server. Here is the binding details
Port : 80
HostName : (Blank)
IP Address: *
And then my custom Application
Port : 80
Hostname : myPortal.com
IP Address : *
If I browse my application with myPortal.com, its coming up fine and I dont have any issues. Here is the Problem. For application availability purpose, i have four failover servers and the application is configured in the same way for each server.
If I want to browse my application with server name in order to find when one of the server is having issues, i m not able to do it
say for eg, if i browse, myPortal.com, its working but if i want to browse myserverA.com, its going to default website
Approach 1 which i tried:
To Overcome this issue, i made host name field as blank for my custom application and updated it with localhost for IIS Default website.
Doubt 1:
It served my purpose but i scare if i have to host one more application in the server default port, i will be getting into trouble. Are there any best approach to solve this issue
Approach 2 which i tried
I left the host name as blank for Default Web site and had myPortal.com for my custom Application and then edited the IP address field for my custom Application. I changed the IP address from "All Unassigned" to "Server IP address"
Doubt 2:
It served by purpose of browsing my application with myPortal.com and myServer.com but what is the impact of changing the IP from "All unassinged" to "Specific Address"?
Also, in future, if i host one more application in default port with different host name, how would i be accessing that server with server name or IP name?
That's exactly what's desired.
To access a certain site with host name on a specific server, you can go and modify hosts file, add an entry for the host name and point to the IP of he target server. Then in your browser you can access it correctly.
Here is the solution which finally worked out
In the custom application, under EditBindings, add one more binding
Leave the hostname as blank for the new binding. Add a port number other than 8080
It helped to solve below issues
I m able to access my custom application through myportal.com and
Also in scenarios, when i have issue with one of the shared servers,
i can try accessing each of the server site individually through
serverNameA:port
So in future, if i want to host one more application in the default port, i have to register new host name for that server and will add one more additional binding for browsing with server name
Hi everyone,
I have configured my web application using IIS7. It is running fine for http:// localhost/, but I need to give some website name like http://myexamsystem.com/
instead of "localhost".
I have tried all the possible ways from IIS7, but I am not getting the result.
Steps I did upto now:
Step 1: Right Click on "Sites".
Step 2: Selected "Add Website" option.
Step3:In "Add web site" dialog box:
Site Name:"myexamsystem", Application Pool: "DefaultAppPool"
Physical path: "desktop\myproject folder"
Binding
Type:HTTP, Ip address "All Unassigned", Port:80
Host Name: "myexamsystem.com"
OK
Error Messege:
This page can't be displayed
•Make sure the web address http://myexamsystem.com/ is correct.`
If this is just for debugging / local development, then you'll need to add an entry in your HOSTS files. This is located:
c:\windows\system32\drivers\etc\hosts
It can be edited in notepad (if you have administrator rights on your machine). You just add the following entry:
127.0.0.1 myexamsystem.com
Note that this will only work locally. If you want it public, then you'll need to buy the domain name and point it to an external IP address.
Update
Just seen your comment about it needing to run on your local network. A quick way is to add your internal network IP address to each machine's HOSTS files. You can find out your internal IP address by typing ipconfig into the command prompt. Then add it to the HOST file of the other machines in the same way as I descibed above, except use your internal IP in their HOST file rather than 127.0.0.1.
If you don't want to manually add them to each computer, then as far as I know, you'll need a DNS server.
I have created a website and set it up on IIS on a Windows Server 2008 R2 which is on the local network. What should I do to be able to access that website by typing its name in the browser from client machine? Right now there're only two sites: One is the Default Website and the other one is my newly created one. If I type this IP in the browser of a remote computer, which has access to the server, the default website opens. If I add https:// to the ip address I get directed to my website. This means the website opened is decided upon the protocol (http or https). What if I add another website that would require SSL?
Actually the site you browse to is not decided by the protocol, it's decided by the port. By default HTTPS is port 443, and HTTP is port 80.
So if you have an HTTPS and HTTP protocol added to a website in IIS, you've created bindings for these two ports automatically.
This is visible by going into IIS clicking "Sites" from the "Connections" section in the left pane and then looking at the "Bindings" column in the center pane.
If you create another website on the host which uses SSL you would have to assign it to a different port.
To browse to that new SSL website you would have to enter the port when browsing to it.
e.g. https://serverName:444
(You don't have to enter default ports, 80 & 443, your browser automatically infers which to use from the protocol type and adds them if no other is present)
This is inconvient for users so people get around this by registering domain names such as stackoverflow.com and pointing them to the address with the port e.g. https://stackoverflow.com:444, so users don't have to enter port numbers.
Have you added the website address to the host file which sits in the drives folder of the system32. If you add the website name against the IP in the host file you should be able to access it using the name rather than than IP address
Something like this- 10.18.20.108 test.stackoverflow.com
How can I access different websites hosted on my local IIS 7.5 (using different bindings) from my ipv4 address?
My system32\drivers\etc\host file has my binding names mapped to 127.0.0.1
In IIS, I have the normal "Default Web Site". Its binding hostname is empty, set to all unassigned ip address and port 80. On my network, I can access this site using the server ipv4 address like so : http://192.168.2.1/mySubSite/index.html where mySubSite is a child folder of the "Default Web Site". I can also access it locally using http://localhost/mySubSite/index.html
If I setup a second website in IIS using the same binding as the "Default Web Site" but using a hostname (say "site2"), I can access it locally using http://site2/mySubSite/index.html.
How can I access this second site on my network the same way I access the "Default Web Site" using the ip address? Is it possible?
the easiest way to do this is to change the port binding on each website. This takes minimal configuration and you can place a website on any port you want (I recommend ports over 1024...to a maximum of 65000)
For example, your default site will automatically be on port 80. Place site 2 on Port 2000. Then you can access your default site like you have above, and you can access site 2 with a similar url like http://192.168.2.1:2000/mySubSite/index.html. Notice the port is specified in the url using the :[port] at the end.
Yes, you can have multiple sites on the same IP address and port. It is called binding by domain name.
Open ISS and go to your first default site (one that is functional) and then go to edit bindings. You will see by default it states "http: Port 80 IP Address *"
Notice the hostname is blank? This is where you can tie a domain name to that exact port. Fill out domain name on both your site bindings. This means when someone comes in from that exact domain name, it knows where to forward traffic too. If port 80 inbound doesn't match either of those two domain names, it will default to w/e site has no bindings such as the "default site".
This is driving me nuts. I am trying to setup a webiste on our dev server with a specific url name www.mystpidsite.com as an example. mystupidsite is not the same name as the dev server.
1) specify a specific url to use for the website I create in IIS
2) run it and use that url to access it
I have:
1) created a new site in IIS 7 in Server 2008
2) attempted to access it via the site name which I set to the desired url and port 8888. So if we want it to be www.mystupidsite.com I setup the website name to mystupidsite in IIS 7.
3) I even tried to create an application under mystupidsite with the same name in IIS 7.
The server is definitely accessible and pingable on the network from my local PC, we have other stuff installed on this new server. Do I need to create an application or is just creating the website enough in IIS 7? I specified the IP as the server's IP in the website I made.
For the host name in the bindings of the site I put www.mystupidsite.com
when I try to access the site via www.mystupidsite.com it can't find it and the site in IIS7 on the dev server is running. It's running on a HyperV instance which is our dev server. Everything else has worked just fine. I just wnat to understand how to get a specific url by name setup.
Do I need to add something in the hosts file on the server or something?
You're not going to be able to have a site on your dev box answer to both the mystpidsite.com and mystupidsite.com domain names.
Unless you have the domains registered and have your domain's nameserver directing that name to your dev machine, IIS is only going to answer to requests either the machine name on the network or the IP address of your machine (in addition to 127.0.0.1 and localhost).
The only thing you're going to be able to do outside that scenario is set up two sites on two different ports on your machine and access them from http://localhost:80 and http://localhost:8888 (or network computer name equivalent).
you need to have an entry in dns to be able to hit the server when using www.mystupidsite.com
Because you have the site running on an alternate port you should be able to get to it by http://your-server-IP-address:8888
If you want to test it locally using the host name and do not have access to dns you can add the appropriate entries to the hosts file on your local machine (c:\windows\system 32\drivers\etc\hosts)
What happens when you type 'nslookup www.mystupidsite.com'? Do you get the IP address of the virtual server?
Do you have the windows firewall enabled on the server? if so, did you add an exception for port 8888?
add a default binding (no host header / blank) and try accessing it by IP