After 4 hours of looking through stack overflow and searching Google I've finally decided to go check in with the "hopefully" gurus...
My problem is this, when querying from the local machine through remote desktop, querying for www.domainname.com/Content/Styles/reset.css i get the css fine.
When doing the same from an external machine, I get a 404 error... I know why, the reason is that it's trying to get the file from:
C:\inetpub\wwwroot\Content\Styles\reset.css
This is kind of bad considering that the website is actually hosted at: c:\http\www.domainname.com\
The error in the browser, from IIS, gives the following information:
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://www.domainname.com:80/Content/Styles/reset.css
Physical Path C:\inetpub\wwwroot\Content\Styles\reset.css
Logon Method Anonymous
Logon User Anonymous
I've been looking at the other sites running on the IIS, and none of them point to InetPub as their directory, so I simply can't see why it's trying to get the item from this path.
Calling the main application, a MVC based site running Umbraco, works fine, or rather, all the dynamic content works fine, just not static content.
To give a little more information:
Currently the IIS 7.5 has 4 sites and 1 ftp server running.
1 site with the following bindings:
http - this 1st site host name - port 80 - ip address *
https - blank host name - port 443 - ip address *
1 site with the following bindings:
http - the 2nd site host name - port 80 - ip address *
1 domain with the following bindings:
http - the 3rd site host name - port 80 - ip address *
The actual domain
http - www.domainname.com - port 80 - ip address *
And finally a ftp server
I hope that someone have any idea what is going on...
Best regards and praying (despite being an atheist),
Poul
Could it be that the Static File Handler is not included for your website?
Check for your website if the Handler Mappings contains Static File as Handler. ( preferrably at the bottom of the list)
Update:
Is there a physical folder under wwwroot called content\styles? or a folder www.domainname.com for that matter?
Did you look at logs from IIS for the application pool of this website
--> C:\inetpub\logs\LogFiles\W3SVCxx (xx = number assigned to your app pool) I forgot how to find that on ( usually I quickly check the couple of folders here.
Maybe it's a security problem -> do you see events in the security eventlogger.
So I found the problem...
It turns out to be a Proxy issue... As this is a new site, the DNS wasn't set up yet and we were using the HOSTS file.
Unfortunately in Bangkok when using a Cable connection, True (the largest ISP) forces you to use a Proxy, without telling you...
Now the DNS was actually pointing to another IIS server...
When I made my request, asking for a file on domain name X.. My machine looked up the IP address through my HOSTS file, sent the request, the proxy then also did a DNS lookup, but got another IP address, and forwarded the request to this IP address instead.
The IIS on that server, knew the IP, knew the domain name, but had another configuration and didn't know the file we were asking for (for the new website)...
So indeed there is a logical explanation for everything, just not always an obvious one.
I actually got onto the problem by testing with another domain, one that didn't exist at all, on this one the proxy of course could not look it up, and started returning code 324.
Related
I Live in Estonia.
The second day I observe some kind of problem with the opening of some of my sites.
Example:
https://cp.nasdaq.ee - sometimes it works, sometimes it doesn't
https://185.252.232.227:8888/ - this is the same site cp.nasdaq.ee, but via IP - always opens properly
If the site is down and i enable the VPN, then it starts working.
In all other countries, the site opens without problems https://www.host-tracker.com/ru/ic/4/697585f4-486b-4c8e-b530-e3f0b6c96972/
This problem have all of my friends (5 men) who live in Estonia.
Perhaps the problem is somehow related to the fact that cp.nasdaq.ee has NS servers in the Cloudflare.com zone, but not all sites connected to Cloudflare have the problem.
I observe the problem only for those sites that are connected to Cloudflare and their A-record leads to ip 185.252.232.227.
If IP 109.205.176.239, 62.171.151.28, 62.171.151.28 are specified, then sites open without problems.
For your information,
all IPs listed are for VPS owned by Contabo.com hosting, the server is located in Germany.
The problematic IP 185.252.232.227 is from one VPS on Contabo, and all the other IPs I listed are from another VPS on Contabo.
And if i turn of status Proxied at CLoduflare.com and set DNS ONLY - then website works well!
Here is such an incomprehensible problem ...
I have tried to send a DNS packet to get an IP of some web-site.
In some cases, like google, the IP was right and when i typed it in the url line it sent me to google.
But in other cases (for example : stackoverflow.com) its gave me an IP that didin't linked to the web-site.
To be sure that my packet is right, i tried to do Nslookap in the command line, and the result was the same.
So i cant find the right IP adress of a web-site.
There is the message that appear when I'm trying to enter stakoverflow
Fastly error: unknown domain: 151.101.65.69.
Please check that this domain has been added to a service.
You (generally speaking) can not open the website just by entering the IP address in your browser's address bar because web servers (and possibly many other network components that are between you and the web server) often do not host only one web site on that IP address so they rely on exact domain name typed in address bar to serve the right content.
I think, it's caused by yours internet restriction. Try to contact your ISP (your internet provider) about this problem. He will probably know more about cause of this problem.
Short answer: you need a host header.
Long answer: Since HTTP/1.1 introduced in 1997 (and then updated in 1999 and in 2014), the request needs a host header. That allows the web server to route a request to a corresponding server configuration, a virtual server in Apache speak. Some servers don't have this configured and is allowing requests to any host to be served from the same web server configuration.
HTTP/1.1 also allowed multi-tenant proxies, as Fastly, to exist in the Internet. Fastly is a CDN - content delivery network - that allows to cache websites content on closer to users and deliver it locally (faster than from a cloud or a colo, thus the name).
When you're not specifying the domain for the request, it looks like your client (or a library) is using the IP address as the host header. That's why the response from Fastly talks about domain: unknown domain: 151.101.65.69.
While Fastly do support service pinning to a dedicated IP address, which would have worked for your request - it doesn't look like stackoverflow is using the feature as they might not need it.
I've got IIS set up on 127.0.0.l and I'm tinkering with adware blockers that use 127.0.0.1 as the address to route malicious sites to (127.0.0.1 www.badsite.com)
Will this make all calls to those sites hit my IIS and make it load a default page?
Is there a way to still block these sites via HOSTS without hitting IIS?
On Win 7 pro.
Yes, all calls to those sites will hit your IIS instance. IIS might return a default page, or a "file not found" page, or if it has an actual page it might return that.
127.0.0.1 is used because it always points to the local machine, which prevents your computer from wasting bandwidth (and possibly DDOSing some poor victim) by trying to send these packets externally. You could try 127.0.0.2 or 127.254.254.254, which would work IIS is listening on 127.0.0.1 specifically or 127.0.0.0/24 rather than on every address on the loopback interface.
There isn't any other address guaranteed to not reach the public Internet, although you may be able to set one up yourself by locally blocking outgoing packets to 192.0.2.1 or the like in your firewall.
Other options for ad blocking include using a local proxy which would return HTTP 404 or the like for blocked URLs or a local DNS relay that would return NXDOMAIN for blocked domains.
Yes, as Anomie points out, they will hit your IIS and then will serve the default page or an error status or an actual page if it finds one (unlikely however).
To avoid that, I use 0.0.0.0 as the address. I've been using it with MVPS Hosts file without any issues for years now.
Also, as this post suggests, you can use 0 too (any invalid ip will do I guess)
Both of these will be a bit faster as they will avoid the wait for timeout on 127.0.0.1.
Another option would be to run IIS another port. If you are running behind a firewall or something like a home router, you could set it to port forward port 80 for incoming requests to your alternate port. (If you're using IIS inside, you'd need to go to http://[your ip address]:[alt port])
I'm runnning IIS 7 on my local dev machine. My website is up and running. To access the website, I need to enter the url with the port number in the browser's address bar (www.ScoobyDoo.dev:91). What do I need to change so I only need to enter the www.ScoobyDoo.dev portion of the url? I've done this before but I'm drawing a blank. Port 80 is hosting a different website so I can't just move this one to the default http port.
Thanks!
If you want multiple sites to reside on the same IP address then you need to use HTTP Host Headers.
Provided that your existing website doesn't use SSL then you can use host headers. To configure host headers in IIS7 you modify the "Bindings" (there's a menu item for this in the right hand side Actions pane for the site):
You want to add/edit your bindings for each site that resides on the same IP address, for example for your scoobydoo.dev site:
The caveat here is that if you have users already browsing your first site by IP address then they will need to be redirected to the site using its domain name.
You can do this by adding a site bound to the raw IP address and creating a HTTP Redirect.
I'm not sure what you're expecting to do here. If something else is binding to port 80, and your web server is binding to port 91, then you'll need to specify port 91 in the web browser when making a request to the server. By default, without being explicitly given a port in the address, a web browser will make the request on port 80 (or 443 for SSL).
You might be able to add an entry to your hosts file (c:\windows\system32\drivers\etc\hosts) where you map the non-specified port version to the specified port version, but I don't think it'll work. That file is for DNS resolution, not port mapping. Worth a try though, I suppose.
Can you clarify a bit on what exactly you're expecting? Or what you think you may have done before? I wonder if you're not giving us the whole picture here.
When using host headers to host multiple websites on the same IP address in IIS, is there any way of accessing that website from a browser running on the local machine?
This is normally required when a given web component only allows configuration from the local machine. It's also useful when things like ASP.Net's built in error handling isn't working and you can only view the error in the browser but don't want to allow remote users to see it.
This has baffled me for a while and everytime I come across it I end up giving up in frustration and reconfigure stuff so I can accomplish such tasks remotely.
Added: #Ishmaeel - modifying hosts doesn't seem to help - you either get a 400 error (if all websites have host headers) or whichever site is configured without a host header.
Just an idea: Mapping the hostname to 127.0.0.1 in the hosts ($WINDOWS$\system32\drivers\etc) file may help. This way you should be able to pull up the local IIS site by typing the hostname as if it's a remote server
Maybe I am not understanding the question, but what's wrong with just typing in the URL for the website? If it's the matter of domain name resolution, you can point to the right DNS or put it in hosts file.
eed3si9n -- if you are trying to access a url locally and you use host headers you cant just type in the url: for example you have 2 websites (website1.com website2.com) on 1 server using host headers. the local ip of the web server is 192.168.1.50 --> if you type in 192.168.1.50 you will get a 'page cannot found'. if you put in the url website1.com or website2.com you will be accessing the sites from the outside (not locally).
so the problem is how to access the sites locally not from the outside -- for example i need this ability so that i can access locally as the test sites are only available locally. not from the outside...
You can try telnetting to the server.
$ telnet localhost 80
(type these lines manually)
GET / HTTP/1.1
Host: www.example.com
(exchange www.example.com for the host name your server is mapped to)
I would assume the only way you can do this is assigning a custom port to the specific website you want to monitor and just access it as "localhost:CustomPort".