Setting Up Web Redirects for Home Leopard Server

Discussion in 'Web Design and Development' started by crees!, Dec 28, 2008.

  1. crees! macrumors 68000

    crees!

    Joined:
    Jun 14, 2003
    Location:
    MD/VA/DC
    #1
    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.
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    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.
     
  3. crees! thread starter macrumors 68000

    crees!

    Joined:
    Jun 14, 2003
    Location:
    MD/VA/DC
    #3
    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.
     

Share This Page