Reputation: 14309
Hold your horses, you might say this belongs on Server Fault, but I'm asking this from the perspective of a developer, not a sysadmin. I can get varied results and see where in the code it breaks (kind of)! I am not a sysadmin, but I feel that other developers may struggle with the same issue (those of us in smaller companies without IIS server admins). I asked a similar question on SF, but they're not really connecting with my issue.
As a developer, I'm having great difficulty figuring out a quick easy way to setup an IIS/ASP development server for use by multiple individuals on a local network. The whole idea is to have this NOT be on the live machine. It's just a little laptop running on one of our desks.
I thought this would be easy. What I did at first was 1) fix an IP address 2) edit bindings for my various dev sites to be 10.0.1.115 on different ports like 2020 etc
This seemed like it worked fine for a while. Coded, coded, coded...but as my C# pages got more complex and response times took longer as responses got bigger, strange strange things started to happen. Some of the symptoms:
1) I'd see an unrelated request to a wrong ip address like 10.0.1.75 for no reason in Fiddler. And then it would retry it over and over, blocking the browser UI. I searched all my code, all hosts files, nothing referencing this IP anywhere. This request seemed to hang the browser "waiting for 10.0.1.75 and the browser would spin even though in fiddler the original request completed and it actually downloaded linked CSS files!!! WTF?
2) slow response times. Extremely slow for some pages. I throw it up on a production server across the country and it loads 10x faster.
3) The really bizarre thing:
// C#:
// I can see this before the odd request gets made! weird, right?
Response.Write("hello");
// then after see "hello", fiddler says request is made to some stupid unrelated ip
Response.Write(strOutput);
// then I never see this output string (a bunch of HTML) rendered in the browser
// it just spins on "hello" page asking for the wrong IP address in the gray status bar
// BUT it shows up as proper HTML in fiddler, and also downloads all the CSS
// that was referenced to by the HTML
Like I said, I can deploy this to a site with a proper domain and it all works fine, using the essentially the exact same webconfig!
I get similar strange/slow behavior on a separate site on a different that also works fine in production (and is completely different style of code).
Yes, I have tried this with and without a proxy on several machines.
Simple (short C# pages work fine).
Took forever to dig this up, but no real answer here: https://serverfault.com/questions/216093/site-loads-very-slow-if-i-use-ip-and-works-normal-when-i-use-domain-name-why
I don't care if this gets downvoted and you call me a doofi. I've been slamming my head against a wall for 6 hours on this.
Should I not be using IP address? Should I setup my own DNS instead of just using fixed IP? I don't want to mess up my network and randomly setup DNS... ugh.
UPDATE
So looks like it may be a hosts thing? I looked at another app on the same dev server and its getting 302 Redirects for HTML linked files to an incorrect IP! But just the root, not the whole filename, like 10.0.1.75 instead of what I might expect 10.0.1.75/somejsfile.js. Nowhere in my code does it do this... Is there something strange about using a fixed IP?
So this explains why the page won't render, because the DOM is not fully constructed...
Upvotes: 0
Views: 311
Reputation: 1999
I wouldn't bother with using differnt ports. In your DNS server add an entry for *.dev.mycompany.com to point to the IP of interest. If you don't want to mess with your DNS you can modify the hosts file in the C:/Windows/System32/Drivers/Etc/Hosts file add an entry for each dev website of interest if you don't have access to your DNS Server. You'll have to do this on each dev machine if you go this route. FYI open notepad as Administrator and open the file and then save do to permission issues in Vista on upwards.
In the IIS Settings of your dev machine add a website1.dev.mycompany.com, website2.dev.mycompany.com to the bindings of each appropriate website.
Then when youa ready for production you just change website1.dev.mycompnay.com to website1.mycompany.com. Your DNS should handle the website1.mycompnay.com. Your DNS or your hosts file can be used in determining your website1.dev.mycompany.com depending on you're restrictions or how you want to handle this.
In other words you are not reliant on IP or ports anywhere in code. Everything is using DNS resolution. It just depends on where you what your resolution to occur...on the company DNS server...or on each dev machine using the hosts file.
I work for relatively small company and that's how we have delt with these issues. Either work. DNS is most flexible as it does not require a change on each dev machine but we have used the host file method when only 1-3 developers are working on a website.
On a side note sadly to say I've even used the host file on a production SQL Server to access a linked server outside of our network so that I could give it a specific name which is required for replication. Probably not suported by MS support but it works.
Upvotes: 1
Reputation: 1971
May be a check in your firewall or proxy configurations could reveal what's causing the problem.
Upvotes: 0