Debugging isnt fun….
But it does have its moments, when you feel you have learnt something new.Like today….
First let me step back a bit and explain ip-domain mapping using host files on Windows. The Hosts file contains the mappings of IP addresses to host names. This file is loaded into memory (cache) at startup, then Windows checks the Hosts file before it queries any DNS servers, which enables it to override addresses in the DNS. The host file is located at ‘C:WINDOWSsystem32driversetchosts’.
Typically, during development, I use host files to map urls for applications under development to the sub-domain of my main site. This allows me to access cookies etc while still running the web-app on my laptop.
While setting up an web-app today I mapped a domain to an ip using my host file, but could not bring the page up no matter how I hard tried. At my wit’s end I called upon our sys-admin and resident Solaris proponent to help me fix this problem. A couple of hours later I was on my way and had a much deeper understanding of server configuration stuff. Before I forget what I learned I figured I may as well save it for posterity by publishing it here.
The problem arose because I was trying to map my domain to an ip of a virtual server. While this is not a big deal (click here to see how Apache does it), there was something weird happening on my machine.
Typically servers, like regular computers, have physical interfaces that connect them to the network. However you can have multiple virtual interfaces each with individually assigned IP addresses on a single physical interface. Within the webserver software, listening sockets were defined and mapped to the IP addresses on our virtual interfaces.
Each of the virtual interfaces are associated with a listening socket and every virtual server instance is bound to that listening socket. Virtual servers themselves can be name based or ip based. IP-based virtual hosts use the IP address of the connection to determine the correct virtual host to serve whereas name based ones use DNS mappings of IPs to decide which host to serve
The behavior I was seeing turned out to be because while the server’s virtual server instances were bound to individual IP addresses, there were also names that identified what was allowed in the host request field sent by a browser. Since I defined a name in my local hosts file that didn’t match a name defined on the server to be associated with the virtual server instance that I tried to reach, the web server sent my browser’s request to its default, or primary instance.
…I am glad its a Friday !
FYI: The Fan has been nominated for Flash Forward as a finalist in the video category. Its pretty gratifying when you see something you have worked on for so long be appreciated by the online community. Check it out here and do show your appreciation by voting for us here. Oh, and while you are at Comcast Labs, check out the other cool stuff thats coming soon.
As I continue to poke my way around with Flex2 in the few hours I get a week, once in a while I keep hitting walls that I dont really expect. And with any new technology, my skills with google search yield few results to ease the pain. Take today for example…
So there I was trying to write this real easy app that would take this not too convoluted XML file and render it in a list with the node-names as the entries. Nothing simpler, you say?…not quite. For the longest time after putzing with the HTTPService class, I was still not able to read the stupid document. I looked at some of the examples couldnt quite find out what I was doing wrong…..until 5 minutes ago.
Turns out HTTPService returns the data as an object by default. To get an XML document back make sure you have resultFormat=”xml” in the HTTPService.
Oh, and remember to keep XML.ignoreWhitespace = “true”.
…source code coming soon.
This is interesting. After seeing a trailer for the movie “Lady in the Water” I was intrigued enough to do a google search for it. The first result I was taken to was an aggregated page of all online reviews for the movie, its avarage rating and google search pages to top words used in the movie. There was also a textfield on the original result page to search for tickets for the movie by entering my zip code. [link]
I had seen such pages for music artists [link]already on google but this was the first time I saw anything for movies.
Just a quick note to all who may want to check FlexAmp out. The demo login is no longer working but if you create your own login on box.net and use that to login, it should be fine. If you still havent played with FlexAmp, you can check it out here.
1) Main interface
2) Music visualization via Flex Charting Components
3) Getting deeper into related media
4) Getting more info via Amazon
5) Browsing user’s history.
If you are a pretty extensively used service, few things can be as bad as having your site go down. Of late a lot of the services I use seem to keep having outages and since most of them proudly display the “beta” badge, the worst you can do is frown a bit and carry on. Its nice , however, when on rare occasions people do add some personality to the otherwise annoying “Service Down” or 404 page. When I went to flickr a few moments back, I saw this page taking another jab at Ted Stevans’ remarks on net neutrality (made infamous by John Stewart. ).
I love sites with personality.