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

crees!

macrumors 68020
Original poster
Jun 14, 2003
2,025
250
MD/VA/DC
I have a couple computers I do development on along with a server (Leopard Server) at home. What I would like to do is host my development sites on the server and be able to access them via a development URL. Now I know how to do this locally with Virtual Hosts and editing the hosts config file just fine. Where I'm stumbling is I entered the IP of the server in hosts.config on one of the machines and the URL I'd like to use, but when I access that URL it gets directed to the main site on the server and not the one I created. How can I get Leopard Server to translate the mysite.dev request to the proper hosted site?

hosts config:
192.168.1.10 mysite.dev

Thanks.

PS - I tried redirecting by messing with my router but couldn't figure that bit out. It would be nice to do it that way because I would just have to add a new entry in the router and then every computer would automatically be redirected than having to edit each machines' hosts config file separately.
 
I haven't done it, but I believe you would also use a port number on the virtual hosts. Then you can set the router to listen for that port number and redirect accordingly.
 
Thanks for the reply. I started to look in another direction and found the answer. The default main site on Leopard Server automatically has an alias of *. So that'll override any virtual hosts (aliases) set up. I ended up adding the domain names I wanted to use under the Aliases tab, removed the * alias from the default site, then have each machine's hosts.conf pointing to the ip of the server with the desired domain name. I might eventually veer to having the router forward specific domain requests to the server but now all is working and maybe I can get some work done. :D awesome.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.