Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Cleverboy

macrumors 65816
Original poster
Ok, so I have a development server on my local network. My Mac is running Apache, and I've used the NetInfo manager to host development servers for a number of different projects. However, while on my local network via Wi-Fi (care of my Airport Extreme) and able to access my Mac through its local address of http://10.0.1.200/, it will ONLY server up the default (ie the last website I added to the name-based list) website on the server. Because all the websites are NAME-BASED, the browser visiting them NEEDS to be using the right name, for them to come up. To do this, on my PC I'd just edit the host file, setting it to point to my Mac's local address:

My host file has entries like:

10.0.1.200 www.perfectcasting.dev
10.0.1.200 www.lotterymap.dev
10.0.1.200 www.iphonewar.dev
10.0.1.200 www.freehear.dev
10.0.1.200 www.freefrag.dev

These all point to separate development websites hosted on my Mac (development versions of real websites hosted elsewhere. On my Mac however, I need to use the NetInfo manager to set these websites to point to the "localhost" of that machine, when entered into the browser. Like this:

Fig5.jpg


So... Question is... can I get my iPhone to resolve an address like this ( www.mydevwebsite.dev to a local machine )? Obviously I can't get at the HOSTS file on the iPhone, and even if I could, I kind of doubt it would work (similar to how it doesn't work on the Mac). I've been scratching my head about whether I can do something using my Airport Extreme... like, give it some custom DNS to pass to machines on the network (which could even be a universal solution).

Anyone a.) Know what I'm talking about, and b.) Have any ideas about solutions?

I have a feeling that if I were able to set up a VPN, and use the iPhone's VPN support, that could solve it, but #1. I don't have OS X Server, #2. I don't know the first thing about VPNs!

Thanks,
CB
 
how about running DNS server locally that defines your dev sites and configure iPhone to use your local DNS?
 
What are you trying to do , why you doing this.

First of all you can use the host name to access the site from your iphone , you don't need the ip, you use the real hostname , not localhost.

Than if your using apache, you can define each of your sites to virtual hosts , which will give you the equivalent of what you are doing with host file.

For even more compatablity, you can run a nameserver, there is one built into osx, and define actual c records for each of your addresses. the drawback is you would need to specify the name server in the search domain,. if it duplicates a name already on the internet , it will go to your site when run from your system.
if you do this be careful, if you do zone transfers, you might actually affect real nameservers on the internet, someone might not like that.

A nice web based configuration tool that works with osx is the free web application called webmin, its been around for some time on linux and has been ported to osx.

Use apache 2 rather than 1.3 which is provided with osx, it has more features and can server files over 2gb (streamed movies).
 
WoW... some people can't read... similar issues here... trying to resolve hostnames in our local network with custom extentions... due to limitations of the VPN and other things... gah... this is anoying... Hoping to find a solution as well...
 
Same here

Not an uncommon problem, I think- doing multiple webapp development on one development machine and you want to point your iPhone/iTouch to it to test. First, I try to do most of my iPhone development using Safari on my PC. That works pretty well, especially in the early stages of the application. When you need to switch over to really using the device, you can either use the IP address as the virtual server's name in Apache's server.xml one application at a time (yes that does work) or run a local DNS server. Perhaps your router allows you to add name entries? More ideas are welcome.
 
IIS allows you to run different websites on different ports. I'm not sure if Apache supports this but it would solve your problem.

http://10.0.1.200:84 could take you to your lotterymap.dev dev site for example.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.