iPhone - Local Networking / Web Server

Discussion in 'Jailbreaks and iOS Hacks' started by Cleverboy, Jul 4, 2007.

  1. Cleverboy macrumors 65816


    May 25, 2007
    Pocket Universe, nth Dimensional Complex Manifold
    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, 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:

    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:


    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!

  2. copland007 macrumors member


    Jun 29, 2007
    how about running DNS server locally that defines your dev sites and configure iPhone to use your local DNS?
  3. michelle21 macrumors regular

    Jun 29, 2007
    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).
  4. reinsnitz macrumors newbie

    Nov 25, 2008
    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...
  5. fool4jesus macrumors newbie

    Jan 23, 2009
    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.
  6. Matt Smith macrumors newbie

    Sep 3, 2008
    IIS allows you to run different websites on different ports. I'm not sure if Apache supports this but it would solve your problem. could take you to your lotterymap.dev dev site for example.

Share This Page