Forum Moderators: phranque

Message Too Old, No Replies

Apache /w lan computers

         

darkfire

6:43 pm on Mar 14, 2005 (gmt 0)

10+ Year Member



Ok here is my situation. I have a freebsd server running apache, and I have another web server running on a xp machine. I have my router set up to serve the webpages off of the bsd apache server. What I am wanting to do now is setup a apache to use the xp web server as well. For example the bsd/apache will run www.mysite.com and then on the xp will run something like xp.mysite.com. Problem is, I don't know how to set this up. Do I setup some kind of virtual directory that maps to the xp directory? And if so how would I do that.

IamStang

1:48 am on Mar 15, 2005 (gmt 0)

10+ Year Member



My suggestion would be to consult your router's manual or website on how to direct traffic to specific ports. Have one box listening for port 80 traffic and the other listening for port 8080 (the port numbers dont really matter so long as your domain points to the correct port AND so long as they are not used by another service on your machines)

EX: www.somesite.com points to XX.XX.XX.XXX:80
www.othersite.com points to XX.XX.XX.XXX:8080
(replace XX.XX.XX.XXX with your IP address)

Atleast this would be the simplest way I can think of. I am sure there are others out there that may have a better suggestion.

sitz

3:57 am on Mar 15, 2005 (gmt 0)

10+ Year Member



Depends a bit on your full setup. If you have multiple IP addresses, you can set up your DNS to point www.example.com to the IP of the BSD host and xp.example.com to the IP of the XP box. If you only have a single IP address, then mod_proxy can take care of things (note, this is utterly untested, and I don't claim to be a mod_proxy expert; This /should/ work, though. I think.):

(assuming your BSD box is running on 192.168.1.10 and your XP host on 192.168.1.11):


NameVirtualHost 192.168.1.10:80

<VirtualHost 192.168.1.10:80>
ServerName www.example.com
ServerAlias example.com

(other directives here)
</VirtualHost>

<VirtualHost 192.168.1.10:80>
ServerName xp.example.com
ProxyPass / http://192.168.1.11/
ProxyPassReverse / http://192.168.1.11/

(other directives here)
</VirtualHost>


You'll obviously need to enable mod_proxy; this is done via the usual LoadModule method, although things are a bit different for Apache 1.3 vs 2.0. You don't say which version, you're running; check the docs for your version at [httpd.apache.org ].

darkfire

6:44 am on Mar 15, 2005 (gmt 0)

10+ Year Member



I'm using 1.3. Was the example you gave with the proxy mod for 1.3 or 2.0?