views:

28

answers:

3

So I'm creating a few webapps that need to be tested over our local network, the projects currently sit on my MacBook which uses the built in Apache "Web Sharing" server.

When developing locally, I just modify my hosts file and httpd-vhosts.conf to create virtual domains for each of my projects, and everything works fine and dandy.

The issue I'm running into is that now I have to test on networked iPads and iPhones, and the url for my project is no longer http://project.local but rather http://192.168.x.x/~user/project.local and all of my paths are now a mess, breaking the projects.

Whats the best way to serve up these pages without having to change all the relative paths manually?

Cheers!

+2  A: 
  • Either jailbreak iPads / iPhones, and alter /etc/hosts
  • Or just add the sites on different port numbers locally (192.168.x.x:80 => site1 192.168.x.x:82 => site2 etc.)
Wrikken
+1  A: 

Set up an HTTP proxy.

I use Charles on my desktop.

You can configure it at the bottom of the settings page for the specific wi-fi network you are connected to.

The proxy will make use of /etc/hosts on the machine it runs on.

David Dorward
A: 

The solution here was to map one domain on my router to always forward to my webserver and just change the local mapping of that virtual domain to whatever project I need to access at the time.

Conor