Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Apache virtual host setup' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Apache virtual host setup
Authored by: Anonymous on Apr 04, '01 08:36:00PM

I'm doing virtual hosting on MacOS X by specifying domain names rather than
portmapping. (I forget what this is called.) It works with all but the most
ancient browsers, and is easier and cleaner because you can have n sites
all hosted from port 80, which makes router configuration easier too. (I'm
also doing this from inside a LinkSys firewall/router.) My ISP doesn't
block port 80 (man, you need a new isp!) so I don't have to play around
with ports like you have to.

Here's what my /etc/httpd/httpd.conf file looks like in the relevant
section. Say 192.168.1.90 is the server's address on the network inside the
firewall.

<VirtualHost 192.168.1.90>
ServerName www.mydomain.com
DocumentRoot "/Library/Webserver/Documents/mydomain"
</VirtualHost>

<VirtualHost 192.168.1.90>
ServerName www.myotherdomain.com
DocumentRoot "/Library/Webserver/Documents/myotherdomain"
</VirtualHost>

DNS for these domains is being served by zoneedit.com. (Zoneedit
kicks butt, at least as far as I can tell after two weeks.)

I can't really see how different the above is from your setup. One thing to
remember is that Linksys routers don't do forwarding on packets coming from
inside the firewall. So you might actually have everything configured right
and working for everyone in the world except you. That's what I found.

Since I'm inside the firewall, requests for my domains return "my" (really
my router's at this point) static IP address, just like they do for
everyone else. The problem is sending http requests to the router from
*inside* pulls up the linksys config page instead of having the packets
forwarded to the MacOS X machine on the local network. (SSH out to some
other host and lynx your way back in to see if things look ok from the
outside.)

I can fix this under OS 8.6 by editing the MacOS Hosts file like this:

www.mydomain.com A 192.168.1.90
www.myotherdomain.com A 192.168.1.90

...but I can't get this to work under OS X! Like others, I've seen that
/etc/hosts tells you to use NetInfo, and I've been trying to use NetInfo
following the suggestions posted in this thread. So far, no luck.

The fact that NetInfo has zero documentation is really annoying. (There's
some old NeXT stuff at Apple, such as

http://www.enterprise.apple.com/NeXTanswers/HTMLFiles/1060.htmld/1060.html

but this hardly counts.)

-Rob Calhoun



[ Reply to This | # ]
Questions about this Hint: Apache virtual host setup.
Authored by: spoon on Aug 25, '02 04:30:30AM

"DNS for these domains is being served by zoneedit.com."

How do you have zoneedit set up?
Pointing to the router's IP, I guess? How does the router point it to the machine, or must the machine have a "real" IP, not an intranet IP?

Could you please explain this point a bit further? I'm trying to configure a Mac OS X 10.2 (not server) machine, with a web server (hosting many domains, with one IP) and also share the DSL modem with the rest of the office (seems like Jaguar has this new feature built in).

Is this even possible with only one Ethernet card and a 2MB DSL modem with a static IP?

I'm not doing the DNS. I use a zoneedit-like service that points DNS to my server's IP -- all the domains to the same IP. I'm planning to host 4 or 5 domains (small sites) on the same machine.

(help!)etc://Lp



[ Reply to This | # ]