[thelist] Apache vhosts across mac/pc lan

Bob Haroche bharoche at usa.net
Tue Mar 5 18:29:01 CST 2002


For development purposes only I have two pc's (win2K) and an iMac (OS 8.6)
networked together, running apache on one of the pc's. I'm not running a dns
server. My question involves setting virtual hosts to be accessed by the
client machines.

pc with apache has ip of 192.168.1.100
mac has ip of 192.168.1.101
second pc has ip 192.168.1.102

I have virtual hosts set up for my client projects as follows:

---------

NameVirtualhost localhost

<Virtualhost localhost>
ServerAdmin webmaster at mydomain.com
ServerName localhost
 <Ifmodule mod_alias.c>
 ScriptAlias /cgi-bin C:/Inetpub/wwwroot/cgi-bin
 </Ifmodule>
</Virtualhost>

<Virtualhost ClientA>
ServerAdmin webmaster at clientA.com
DocumentRoot C:/Inetpub/wwwroot/clientA/
ServerName ClientA
 <Ifmodule mod_alias.c>
 ScriptAlias /cgi-bin C:/Inetpub/wwwroot/cgi-bin
 </Ifmodule>
</Virtualhost>

<Virtualhost ClientB>
ServerAdmin webmaster at clientA.com
DocumentRoot C:/Inetpub/wwwroot/clientB/
ServerName ClientB
 <Ifmodule mod_alias.c>
 ScriptAlias /cgi-bin C:/Inetpub/wwwroot/cgi-bin
 </Ifmodule>
</Virtualhost>

--------

The host file for the pc with apache reads:

127.0.0.1  localhost
127.0.0.1  clientA
127.0.0.1  clientB

--------

This works fine on the pc running apache: http://clientA resolves to the
/clientA directory as a virtual root.

But on the mac and the second pc, I can't access pages via http://clientA,
but only via http://192.168.1.100/clientA.  In that context, the clientA
folder is not considered the root and my root relative linking won't work.

How can I get the networked computers to see clientA directory as (virtual)
root?

1. Re-configure http.conf server doc root to point to clientA directory? --
This works obviously but is clunky.

2. Modify my vhosts directives and/or hosts file? I"ve tried different
combinations of IP and names but can't find the "magic" one. I also don't
know how macs handle its hosts file.

3. Use some sort of mode_rewrite to re-map URL's?

I've tried RTFM but I could use some specific advice.  Thanks.


--
Regards,
Bob Haroche
O n P o i n t  S o l u t i o n s
http://www.OnPointSolutions.com






More information about the thelist mailing list