Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Mac into a personal WiFi hotspot for the local MAMP-based server?

I usually do a lot o development/testing on my local Mac / MAMP installation and then accessing it from my smartphone/tablet by just entering the proper IP address when the devices are on the same network.

However, I'm also often in a situation that I need to demo or test my web apps in places where there is no internet and my devices are not on the same network. What could I do then?

So again what I'd like to do is the following:

  1. Have my Mac acting as a local server (MAMP)
  2. Have my Mac (seemingly) act as a hotspot broadcasting a network via WiFi
  3. Be able to connect to that network (via WiFi) from my iPhone/iPad
  4. Access my Mac's MAMP local sites via the browser from my iPhone/iPad (without "Internet")

Again there is no "real" internet or other APs involved. It would be ideal if my Mac could also act as a DHCP server (so automatically assign IPs to devices connected via WiFi), but if thats too complex then I'll just enter the static IPs manually. BTW I don't need any fancy stuff like local domain names - just IPs are fine :)

Any ideas how one could accomplish something like this? If needed or it makes this workflow easier or quicker - I'm also not beyond buying other software to accomplish this.

BTW for example I had high hopes for this solution but it seems incomplete since my devices are still reporting that the network has no internet and are refusing to connect. Built in Mac connection sharing might also help somehow (not yet sure how?) but what connection to share if they're all offline?

like image 494
Michael Avatar asked Jan 17 '14 11:01

Michael


1 Answers

I'll post my partial answer here - it will hopefully benefit somebody in the future.

In the end it was pretty easy:

  1. go to the Sharing panel in System Preferences, click on the Edit button by the first Computer Name edit box and then change the Local Hostname to something short, nice and readable (like for example web.local)
  2. click on the WiFi icon on you'r Mac's status bar menu and select Create Network... on the bottom of the menu, give your new WiFi network a name (+ other option if you'd like) and click create
  3. don't forget to fire-up MAMP (or any other server you might be using)
  4. and voila - you can now see the new WiFi network from your iOS/Mac devices, connect to it and use the previously created address (i.e. http://web.local) to access your MAMP server (my mistake previously was that I wanted to take the harder/universal way with local DHCP/DNS servers and IP addresses - but this is much easier and the OSX does everything for you)

Its unfortunately partial because it works only with Apple's Mac/iOS devices - other devices (have tried it with Android) will simply not see the personal network you've created (I assume details are being transmitted via Apple's Bonjour anyway so thats why). But better something than nothing.

But its still pretty cool - I can now connect my iPhone and iPad to the MAMP running on my Mac even without being connected to the Internet or having a DHCP-enabled AP taking care of the networking details.

like image 184
Michael Avatar answered Jan 02 '23 12:01

Michael