How can iPhone browse web-site hosted on web server on MacBook? No other hware

Discussion in 'Mac Basics and Help' started by ronslow, Jun 8, 2011.

  1. ronslow macrumors newbie

    Joined:
    Jun 8, 2011
    #1
    How can iPhone browse web-site hosted on web server on MacBook? No other hware
    As per the title.

    If I want to demo a website that is hosted on a macbook web server from an iPhone/iPad ... and all I will have with me is the macbook and the iPhone/iPad .. no internet connection, no wireless routers etc.

    How can I do that?

    Thanks
     
  2. 42streetsdown macrumors 6502a

    42streetsdown

    Joined:
    Feb 12, 2011
    Location:
    Gallifrey, 5124
    #2
    There is a basic Apache server running inside OS X. any static site dropped it the "Sites" folder of your home directory is served to http://localhost/~yourshortusername/ or http://127.0.0.1/~yourshortusername/

    alternatively if you pop the files in /Library/WebServer/Documents/ it'll be served on http://localhost/ or http://127.0.0.1/

    You can set up a wifi network from your macbook.
    Clicking the airport button in the toolbar and clicking "Create Network..."

    Connect to the WiFi network you just created with your iPhone.
    Now go to the network settings on your mac.
    Select airport, advanced..., TCP/IP, and type the IPv4 Address into your iPhone's web browser.
    it should be something like 169.254.161.118.
    if your webpages files are in /Library/WebServer/Documents/ the IP address you just typed in will work and you're done.
    if they are in you home folder, it'll be the IP plus ~shortusername 169.254.161.118/~shortuser
     
  3. 42streetsdown macrumors 6502a

    42streetsdown

    Joined:
    Feb 12, 2011
    Location:
    Gallifrey, 5124
    #3
    now if you have scripts besides javascript (like php) you'll need to install the appropriate libraries
     

Share This Page