Can Access Website using IP address on a Network but Not Using Host Name - iis-7

I am hosting a website on the intranet. I configured the hosts file in etc folder and added the following:-
10.XXX.42.67 GSOnlinePortal.com
In IIS7 i have added my website and this is how my Site Binding looks like:
Now when i access this website on the host machine using http://GSOnlineportal.com, it works just fine. But i cannot access it through a different (remote) computer on a network.
If i change my binding on the IIS to look like this:-
Now i can access this website both on the host machine and a remote machine on network using http://10.XXX.42.67/ without any problems.
What is want is to access the website on remote machine on a network using http://GSOnlinePortal.com. Please help. I am fairly new and have finally come close to achieving this. Will highly appreciate it. Thank you.

The local etc/hosts file is used to provide domain name resolution services to the local system. The remote system from which you are trying to open the website is unaware of this mapping and cannot resolve the name GSOnlinePortal.com to IP 10.XXX.42.67. Two solutions are available for your problem:
If you have a DNS server available in your network, you could register the name there. (Recommended)
You could add the mapping in the hosts file of every system you want to access the web site.

Related

Host ASP.Net MVC Site

I've created a site using ASP.Net MVC that is meant to be stored on a local machine at my place of work. The intention is to have the site stored on this machine, but then accessible by all the other machines within this building.
I've followed Microsoft's tutorial as well as Code Project's tutorial, but I am not having very much luck. The binding is just the localhost, port 80, with * for the IP address. The URL is localhost/GrantTracker.
I've opened the ports within the firewall, checked the permissions on the directory (which is just within wwwroot), tried having the site take the place of the default IIS site (as Microsoft tutorial has you do) and tried having the site stand on its own with its own port (per Code Projects tutorial).
On the host machine I am receiving the standard "This site can't be reached, localhost refused to connect" which feels like either a port or permissions problem. I must be missing a step, but I can't seem to find what it would be. I am new to hosting sites through IIS so forgive me if I am just missing something basic.
I find it a bit strange too because my project uses Windows Authentication and when the site is first visited it performs that initial check with the user, authenticates, but then throws me the error.
Anyone have any ideas? Thanks in advance.
start simple,
create a simple html page, create an IIS application for it, on port 80.
Check and make sure you can see that page from another computer using the internal IP address of the the host machine so something like:
http:\\192.168.0.3\hostapp\test.html .
You can see the proper URL by running it from IIS, this will give you the entire URL you need, with localhost then just replace localhost with the IP address of the host machine to see it on other machines.
Do this in the original IIS folder so you don't encounter any folder permission issues. If you choose another folder you'll have to give access to the Network Service user ( i think, can't remember now, but there is a specific user that needs access to the folder where the website is deployed )
if you can see the page then deploy a proper website and do the same thing. Make sure the app pool is created correctly and it's up and running, then access it again on other computers and it should work.
Port 80 should be open by default so that should not be an issue.

Multiple websites under a folder in IIS

I have a problem with websites in IIS.
The first thing that I did was that I set basic .html website in IIS under Default website (port 80). I moved the code in C:\inetpub\wwwroot\Test and it works.
When I type in the browser localhost/Test, it works but I have an ASP.NET Core web app and I want to open it using localhost/MyAspNetSite in the browser. Is this possible???
I'm asking that because when I right click on the Default website I have no possibility to add new website, only virtual directory or application. In my case, I put my .net code in C:\inetpub\wwwroot\New and in I added the new website on port 5000 and it works like localhost:5000 but not like localhost/New. I hope that you understand me.
Is it possible to have two websites on the same port or to connect two websites or something like that?
I am sending image about this problem. Thank you
You can host multiple sites under the same IP Address. In this case, the IP Address is called "Shared IP Address". This concept is used by all the shared host providers in this world.
That you basically need to do is to go to your IIS -> click your domain -> Bindings -> and add "www.yourDomain.com" and "YourDomain.com" to the IP. If you have a second site, you just have to do exactly the same thing, you can check this blog post it can help u to understand all that things
http://woshub.com/run-multiple-websites-on-the-same-port-and-ip-address-on-iis/

How to host Asp.net website with SQL Server database on server (personal Laptop)

I have website which was developed in ASP.NET, I want to host this website on a server which is my own laptop (for test purposes). Also the website has interaction with SQL Server. So then anybody can use this website when my laptop is turned on. Is it possible? If yes, please inform me of the correct way to host my website
You just have to install IIS on your PC and use it as a web server. Your site will be available by IP or domain name (how-to or Youtube how-to). Also you can use dynamic IP and domain name with Dynamic DNS service like dyn.com

unable to connect through website using localhost or IP address

I am trying to connect to a website which is hosted locally on a server but unable to connect. I have reset the IIS and try to connect it using local host but its is not working. I haven't change any thing and able to connect through it yesterday.
Can some please help and tell me what to do and what are the possibilities that why I am not able to connect.
Try to check three things.
If you are using a local host name check that, the same bindning is set on your site and that the same host name row exists in your hosts file (usually in C:\Windows\System32\Drivers\etc\hosts) like this example:
127.0.0.1 localsite.dev
Check that the sites root is pointing to the correct directory on your local machine.
If you have access to a local development tool, like Visual studio, try to compile and see if build errors exists.

Access Website through LAN using Domain name

I have created a website using Visual Studio 2010 Express and pasted it inside C:\intpub\wwwroot\ as it is. I have Windows7 home premium with iis7. Now inside IIS Manager I converted that directory into Application named newapp.
Now to access this application I am using http://localhost/newapp/ and on LAN I am using http://ipaddress/newapp/. It is working perfect.
I want to access this application without specifying the IP address each time.
How can I able to replace the IP address with some domain name to access the website? for ex, http://somename.com/newapp/.
note:please keep a backup copy of your existing host file before making any change
Open notepad or similar software as administrator then navigate to:
C:\Windows\System32\drivers\etc
and open the hosts file.
make entry for your ip addess as shown below
102.54.94.97 rhino.acme.com
now type in the mapped host name in your web browser

Resources