Deploying my website to the pulic using IIS and windows server - asp.net

I recently bought a domain. Let's say my domain is "domain.com", and I made a website in visual web dev. using ASP.NET and VB.NET. I also have an old computer that I turned into a home server so I installed windows server 2008 R2 SP2. So I uploaded my website to a folder and went to the IIS manager. There I added a website, set the sitename to "domain.com" application pool to "ASP.NET v4.0". Then the physical path to: "c:\websites\wwwroot\domain.com" then in the bindings I added 3 different things.
type hostname port IP adress
http www.domain.com 80 my IP found at www.what'smyip.com
http domain.com 80 my IP found at www.what'smyip.com
http *blank* 80 192.168.1.6(my server's internal IP)
I made sure port 80 is open in my router and I added a firewall inbound rule for port 80.
When I connect using 192.168.1.6 I get my website and everthing works like it should.
However when I connect using domain.com or www.domain.com I see a 404 page. http://prntscr.com/42ynf4
Also when I change my bindings and I change the IP for domain.com and www.domain.com like displayed below:
type hostname port IP adress
http www.domain.com 80 192.168.1.6(my server's internal IP)
http domain.com 80 192.168.1.6(my server's internal IP)
http *blank* 80 192.168.1.6(my server's internal IP)
It works just like it's supposed to?
I have done a DNSlookup on the domain and it's active. I'm a little bit stuck on this and I know you guys aren't experts on hosting but you all probably have more knowledge about this then I do.

You should check what is the server IP address (netstat), because you could use a proxy and then the Internet IP info will be not correct.
Also, make sure that you set the correct home page in IIS.

Related

disk2vhd of working IIS7 Web Server - cannot connect from internet

Did a disk2vhd of our online production Windows Server 2008R2 server that runs an IIS7 Web Server that serves up our business application:
Launched the VHDX in a Hyper-V VM on a new Windows Server 2016 server.
Gave the VM its own public IP address.
Repointed one of our unused domain names in DNS to point to the VM's public IP address.
In the VM - edited the IIS7 site's bindings - removed the old bindings - and added the bindings for the new domain name.
Port 80 is open to the VM on our Cisco firewall.
The VM's Windows Firewall is turned OFF.
We can ping/RDP/SSH/etc. the VM with no issues!
The problem is that we cannot connect to the IIS web server at all - we get "Refused Connection" [ERR_CONNECTION_REFUSED] errors - (NOT 404 errors).
localhost... We cannot connect to the IIS Server in the VM via localhost (gives a 404 error) - but since we cannot connect via localhost in the production server either, I don't think that matters (also gives a 404 error).
Running out of ideas... help?
[...edit... IIS site binding information for this new server VM]
Remember, this VM is a copy of our real server - so...
I deleted all of the previous domain specific bindings for the IIS site.
I kept the standard bindings (but changed localhost private IP address):
type: host name: port: binding info.:
--- --- --- ---
http localhost 80 10.10.10.99
net.tcp 808:*
net.pipe *
net.msmq localhost
msmq.formatname localhost
And I added the entries for binding this copy of the IIS site to the new domain name - (not worried about https yet):
http domain.com 80 *
http www.domain.com 80 *
[...edit... Hyper-V network]
In Hyper-v manager we created a new "External" virtual switch.
We added a "Network Adapter" to the VM, but never got anywhere... so we changed to a "Legacy Network Adapter" and tried everything again... and still no IIS connection.
And, as I said... all other network services that we need to use against our server (RDP, etc.) work... that makes me believe it's only IIS that is the problem.
CBruce
Found it...
Our consultant was trying to test with localhost after we first loaded the VM - (he didn't know at that time that the production server did not work with localhost).
He forgot that he had changed the HTTP IP listener from 0.0.0.0 to 127.0.0.1 while testing. Therefore, a connection attempt was never getting to the IIS Server - it was being blocked at the interface.

How to access my sites on IIS 7.5 from outside my network on Windows Server 2008

I'm new to Windows Server 2008 and IIS, so please be patient.
I want to access my sites from outside my network.
I can browse my sites from the localhost, it's working.
I've added a binding to my site, Type: http, Host Name: www.dev.com, port: 80.
I have a static IP from my ISP, and my router is forwarding http requests to my server.
If I remove the Host Name and access directly using my network IP address, I get my site, but I want to provide a host name to the site because I'm going to add another web sites.
I've added www.dev.com to the DNS with my IP address.
What should I do next?
Thanks
I found the answer to what I was looking for, I should've done this:
create virtual application www.dev.com under default website on IIS,now I can access the website using STATIC_IP_ADDRESS/www.dev.com .

Multiple domains in 443 port in same IP

i have hosted the one website "www.example1.com" in port 443(https) in IIS 7. now i bought a new domain for "www.example2.com" for same IP. i would like to host the another website in this domain(www.example2.com) in port 443(i already used port 443 for "www.example1.com").
How can i do this? Is this possible to host two domains in port 443 in same IP? If yes could anyone please let me know the right way to do this? I am using IIS 7.
It CAN be done.
SSL Host Headers in IIS 7 allow you to use one SSL certificate for multiple IIS websites on the same IP address. Through the IIS Manager interface, IIS only allows you to bind one site on each IP address to port 443 using an SSL certificate. If you try to bind a second site on the IP address to the same certificate, IIS 7 will give you an error when starting the site up stating that there is a port conflict. In order to assign a certificate to be used by multiple IIS sites on the same IP address, you will need to set up SSL Host Headers by following the instructions below.
What Type of SSL Certificate Do You Need?
Because you can only use one certificate, that certificate needs to work with all the hostnames of the websites that you use it with (otherwise you will receive a name mismatch error). For example, if each of your IIS 7 websites uses a subdomain of a single common domain name (like in the example below), you can get a Wildcard Certificate for *.mydomain.com and it will secure site1.mydomain.com, site2.mydomain.com, etc.
If, on the other hand, your IIS 7 sites all use different domain names (mail.mydomain1.com, mail.mydomain2.com, etc.), you will need to get a Unified Communications Certificate (also called a SAN certificate).
Setting up SSL Host Headers on IIS 7
Obtain an SSL certificate and install it into IIS 7. For step-by-step instructions on how to do this, see Installing an SSL Certificate in Windows Server 2008 (IIS 7.0).
Once the certificate is installed into IIS, bind it to the first site on the IP address.
Open the command prompt by clicking the start menu and typing “cmd” and hitting enter.
Navigate to C:\Windows\System32\Inetsrv\ by typing “cd C:\Windows\System32\Inetsrv\” on the command line.
In the Inetsrv folder, run the following command for each of the other websites on the IP address that need to use the certificate (copy both lines):
appcmd set site /site.name:"<IISSiteName>" /+bindings.[protocol='https',bindingInformation='*:443:<hostHeaderValue>']
Replace <IISSiteName> with the name of the IIS site and <hostHeaderValue> with the host header for that site (site1.mydomain.com)
Test each website in a browser. It should bring up the correct page and show the lock icon without any errors. If it brings up the web page of the first IIS site, then SSL Host Headers haven’t been set up correctly.
in iis 7.5 or newer versions
- Sites > Add Website
- Site Name: example2.com
- Physical Path: select directory
- Binding: same ip as example.com
- Host name: example2.com
then in binding check this for both websites
You can't in IIS7 - each HTTPS binding requires a unique IP/port combination because the Host Header cannot be used to differentiate sites using SSL. This is because the host header is not visible during the SSL handshake.
Your workaround is to differentiate the sites by binding to a different external IP, or by binding to a port other than 443. Both options are less than ideal I know.
There's a great MSDN blog on this.
Fortunately IIS8 appears to have a solution in the form of Server Name Indication (SNI).
Interestingly this is not an IIS quirk, Apache has the same issue, as would any web server before the introduction of SNI.
I currently use IIS 6.0.
I have managed to set up multiple web sites using port 443 and different certificates.
From the IIS manager, go to the web site and edit site bindings.
Simply make sure that the Require Server Name Indication box is ticked and leave the IP address: as All Unassigned.
You now use the same port (443) for multiple sites by selecting the appropriate certificate for the site from the dropdown list of certificates.
We also host multiple sites in port 443 but we need UNIQUE IP addresses for each site.
You cannot bind multiple sites to port 443 using only one IP address.
Unless there is a work-around, but I'm not aware of any.
This article may help:
http://www.harbar.net/articles/ssl.aspx
If you are using a wildcard certificate, just use the format *.domainname.com in the friendly name and the IIS GUI will enable the hostname control for you when you are editing the binding.
Source

Setting up IIS 7 webserver - have static ip and port forwarding, what could be wrong?

I am trying to set up a simple website on an IIS 7 server on my home machine. It is going to have light traffic and will only be up for a little while so I don't want to go the commercial hosting route. I am having trouble accessing the site from outside of my local network. So far my setup is:
IIS 7 with the default iis7 page (this is sort of my control/test page)
Static IP
port forwarding on port 1108 from my extermal ip:1108 to my static internal ip:1108
Any idea what could be wrong? My friends who are trying to connect say that they are not getting a "could not connect to server" error on their end.
Thanks!
If this is a standard iis install it is running on port 80 and not 1108.
Also check if "windows firewall" is enabled on your network connection. If the firewall is on it should allow http traffic (under 'allowed programs and features')

Running asp.net site on Windows Server 2003 and accessing it over LAN

I want to run an ASP.Net application on Windows Server 2003 and access it over a LAN.
Like http://serverIP/sitename.com
How do I do this? What configuration changes should I make to IIS?
There are 2 scenarios (assuming you want/have to use IP's in the URL):
You site is the only web-site running on your web-server - you can set up your site with the default port 80 binding, i.e. you don't specify a host name or IP address. This means any request on port 80 will route to your site (remember to stop or delete the "Default" web site, as it normally has the default port 80 binding)
You have multiple sites running on your server - you need to assign an additional IP address for that server and specifically use that IP in the http binding for you site.

Resources