Multiple servers on different physical machines

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Multiple servers on different physical machines

Postby serutan » 08. December 2005 21:06

How do you set up Apache on TWO physical machines, using the same external IP address?

I have a single static IP address and a DLink router that connects various computers as 192.168.0.x. Apache is running on my Linux box, and I want to run second Apache server on a Windows machine. How do I set it up so the Linux server is and the Windows server is, for example?

The DLink is configured to send port 80 requests to the Linux box. Assigning another port to the Windows box certainly works, but then users must include the port number in the Url.

Setting up a VirtualHost on the Linux box using Redirect to send requests to the Windows box also works, but then the user's web browser shows the internal URL such as "http://192.168.0.x" which they cannot bookmark.

All the references I can find to "multiple servers" talk about multiple Virtual servers on a single machine. There must be a way to handle multiple Physical servers. Or is there?
Posts: 1
Joined: 08. December 2005 20:36

Postby Wiedmann » 13. December 2005 13:28

Not really possilbe with two seperat machines behind a nat router...

You can make two VHosts on one machine. And one VHost is a reverse proxy to the second machine.
AF Moderator
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby wizazz » 16. January 2006 23:19

hmmm i wonder... i never tryed it yet..... but cant you do this?....
In your Apache Config file set your host lookup so it looks up the NAME instead of the IP???? at your DNS service it has your same IP for both WWW ... and when it looks at your server/router ..instead of finding the ip address to machines it finds the webnames...

i know in the windows version it could be possible... dunno bout linux... i havent even gotten lampp to even function after installs in linux.... but heres few areas i was talking about in apache config file...

Code: Select all
### Section 2: 'Main' server configuration
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.

# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g.
ServerAdmin admin@localhost

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
# If this is not set to valid DNS name for your host, server-generated
# redirections will not work.  See also the UseCanonicalName directive.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
ServerName localhost:80

# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client.  When set "On", Apache will use the value of the
# ServerName directive.
UseCanonicalName Off

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.

AND HERE....................

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (
Listen 80

By using these features above im sure theres a way to setup 2 webnames or more on one or 2 machines......

turning "ON" UseCanonicalName and have it LISTEN on a different port might help too.... try one at 80 the other at 8080


and the other...


Wouldnt that work??? even tho its on same ip?
Posts: 12
Joined: 08. October 2005 00:48

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 24 guests