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

ronslow

macrumors newbie
Original poster
Jun 8, 2011
2
0
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
 
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.