|
Home > Archive > Apache Server configuration support > August 2006 > 2 servers - one ip address ???
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
2 servers - one ip address ???
|
|
| pcplod@hotmail.co.uk 2006-08-29, 1:39 pm |
| I have a broadband connection that has a router connected to it.
I run 2 computers, one as just a computer, the other as an Apache
server. My son uses another PC just as a computer.
My son now wants his own server, and learn more about setting up and
running his own.
Therefore can I run 2 seperate PC's as Apache servers on the same ip
address ?? thru the same router.
| |
|
| pcplod@hotmail.co.uk wrote:
> I have a broadband connection that has a router connected to it.
>
> I run 2 computers, one as just a computer, the other as an Apache
> server. My son uses another PC just as a computer.
>
> My son now wants his own server, and learn more about setting up and
> running his own.
>
> Therefore can I run 2 seperate PC's as Apache servers on the same ip
> address ?? thru the same router.
Using different ports for each server you can. Apache listens to port
80 by default. You could tell Apache to listen to say port 8080. You
would than have to call the server like
http://wwww.myservername.com:8080 <-- Server #2
http://www.myotherserver.com <-- Server #1
| |
|
|
| Davide Bianchi 2006-08-29, 1:39 pm |
| On 2006-08-29, pcplod@hotmail.co.uk <pcplod> wrote:
> Therefore can I run 2 seperate PC's as Apache servers on the same ip
> address ?? thru the same router.
You could use one of them as a Proxy and 'proxy' the second one through the
first one, this way you have only one IP but multiple servers behind it.
See the documentation for mod_proxy.
Davide
--
Yes, Virginia, there is a Santa Claus. He wears red to hide the
bloodstains, and he brings fscked disks to bad sysadmins. That
means all of us, according to Santa Claus.
| |
| Stuart Miller 2006-08-29, 1:39 pm |
|
"David" <youcantoo@findmoore.net> wrote in message
news:etWdnf4XeZMH6mnZnZ2dnUVZ_uWdnZ2d@ce
nturytel.net...
> pcplod@hotmail.co.uk wrote:
>
> Using different ports for each server you can. Apache listens to port 80
> by default. You could tell Apache to listen to say port 8080. You would
> than have to call the server like
>
> http://wwww.myservername.com:8080 <-- Server #2
>
> http://www.myotherserver.com <-- Server #1
I agree, but there are some complications.
You should be restricted to one server on a router, but you can get around
this.
First server can be put in a 'dmz' exposed to all of the internet - all
traffic passes through to a specific computer. For example, 192.168.0.80
could be your primary server, accessed through usual url such as
mydomain.com.
For the second physical machine, you would port forward say, 8080 to the
second physical server, 192.168.0.81.
If you do not use a dns forwarder, you would access server 1 as 1.2.3.4 or
1.2.3.4:80, and server 2 by 1.2.3.4:8080
where 1.2.3.4 is the ip address of your router.
If you do use a dns forwarder, then it would be mydomain.com and
mydomain.com:8080.
You may be able to have a second domain name automatically forwarded to port
8080, that depends on the features offered by the dns forwarder.
This arrangement may not work with all routers, that depends on the features
offered.
Stuart
| |
| Flamer 2006-08-29, 7:39 pm |
|
pcplod@hotmail.co.uk wrote:
> I have a broadband connection that has a router connected to it.
>
> I run 2 computers, one as just a computer, the other as an Apache
> server. My son uses another PC just as a computer.
>
> My son now wants his own server, and learn more about setting up and
> running his own.
>
> Therefore can I run 2 seperate PC's as Apache servers on the same ip
> address ?? thru the same router.
All the above comments are wrong,
you CANNOT have two machines with the same IP address, what you need to
do is, use a public address for each machine, ie 10.0.0.1 and 10.0.0.2
then enable NAT on your router and setup a static translation for each
machine, so you can have for example if your outside real ip address is
40.0.0.7, translation 40.0.0.7:80 to 10.0.0.1:80 and 40.0.0.7:8080 to
10.0.0.2:80.
then if you own a domain, setup an a-record for it, then you can go to
mydomain.com:8080 and you will end up at 10.0.0.2 but you will not be
able to see the actual ip address of the server which is also a great
security improvement.
Have a look at your routers docs for configuring NAT, all machines
behind the router should have a unique ip on the same subnet ie
10.0.0.x and they will all be translated behind your one real ip
address.
Flamer.
| |
| Flamer 2006-08-29, 7:39 pm |
|
Flamer wrote:
> pcplod@hotmail.co.uk wrote:
>
>
> All the above comments are wrong,
>
> you CANNOT have two machines with the same IP address, what you need to
> do is, use a public address for each machine, ie 10.0.0.1 and 10.0.0.2
> then enable NAT on your router and setup a static translation for each
> machine, so you can have for example if your outside real ip address is
> 40.0.0.7, translation 40.0.0.7:80 to 10.0.0.1:80 and 40.0.0.7:8080 to
> 10.0.0.2:80.
>
> then if you own a domain, setup an a-record for it, then you can go to
> mydomain.com:8080 and you will end up at 10.0.0.2 but you will not be
> able to see the actual ip address of the server which is also a great
> security improvement.
>
> Have a look at your routers docs for configuring NAT, all machines
> behind the router should have a unique ip on the same subnet ie
> 10.0.0.x and they will all be translated behind your one real ip
> address.
>
> Flamer.
Sorry that top sentence it should say PRIVATE not public.
Flamer.
| |
| Rob / gompy.net 2006-08-29, 7:39 pm |
| <pcplod> schreef in bericht
news:vsm8f21hhnu12l7n0d5mk8ab1dv94848nb@
4ax.com...
>I have a broadband connection that has a router connected to it.
>
> I run 2 computers, one as just a computer, the other as an Apache
> server. My son uses another PC just as a computer.
>
> My son now wants his own server, and learn more about setting up and
> running his own.
>
> Therefore can I run 2 seperate PC's as Apache servers on the same ip
> address ?? thru the same router.
Create on computer1 a index.html and a empty.html
Put in the index.html next text.
<html>
<head>
<title>
Welkom op www.other-computer.net
</title>
<frameset rows="*,100%">
<frame name="empty" src="empty.html">
<frame name="other-computer" src="http://ip-other-computer:8080">
</frameset>
</html>
In the frame you will open now the other Apache-server on port 8080 without
other poeple know it.
--
CU, Rob - 52°38'21"N 4°44'34"E
www.gompy.net
www.modelbouw.gompy.net
| |
|
| "pcplod@hotmail.co.uk" <pcplod> wrote in
news:vsm8f21hhnu12l7n0d5mk8ab1dv94848nb@
4ax.com:
> I have a broadband connection that has a router connected to it.
>
> I run 2 computers, one as just a computer, the other as an Apache
> server. My son uses another PC just as a computer.
>
> My son now wants his own server, and learn more about setting up and
> running his own.
>
> Therefore can I run 2 seperate PC's as Apache servers on the same ip
> address ?? thru the same router.
Listen to Davide
Although each machine will have it's own internal IP address.. set up
your son's domain as a virtual domain on your machine and just mod proxy
the requests through to his machine.
Your httpd and his will both respond on the standard port 80.
----== Posted via webservertalk.com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.webservertalk.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
| |
| Flamer 2006-08-30, 1:27 am |
|
Mark wrote:
> "pcplod@hotmail.co.uk" <pcplod> wrote in
> news:vsm8f21hhnu12l7n0d5mk8ab1dv94848nb@
4ax.com:
>
>
> Listen to Davide
>
>
> Although each machine will have it's own internal IP address.. set up
> your son's domain as a virtual domain on your machine and just mod proxy
> the requests through to his machine.
>
> Your httpd and his will both respond on the standard port 80.
>
>
>
>
> ----== Posted via webservertalk.com - Unlimited-Unrestricted-Secure Usenet News==----
> http://www.webservertalk.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
> ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Can we just make it clear so we don't keep giving this guy wrong
information, setting up a "virtual domain" and mod proxying it actually
requires that you own this domain name and have it registered.. in this
case there is absolutely no reason to proxy anything, you have two
servers each with its own domain, that would require an a-record each
and a nat.
I am guessing the original poster doesnt own two domains, nor do they
want to. I hardly think using iframes is a good idea at all.. you mean
when the son wants to create a document he also has to create a
document to call that document on the other server too??
Flamer.
| |
|
| On Tue, 29 Aug 2006 18:14:23 +0000, Stuart Miller wrote:
>
> "David" <youcantoo@findmoore.net> wrote in message
> news:etWdnf4XeZMH6mnZnZ2dnUVZ_uWdnZ2d@ce
nturytel.net...
>
> I agree, but there are some complications.
>
> You should be restricted to one server on a router, but you can get around
> this.
You do? Why? Says he with separate mail, web, database servers.
> First server can be put in a 'dmz' exposed to all of the internet - all
> traffic passes through to a specific computer. For example, 192.168.0.80
> could be your primary server, accessed through usual url such as
> mydomain.com.
> For the second physical machine, you would port forward say, 8080 to the
> second physical server, 192.168.0.81.
You would have to do some fancy ( and imo unnecessary ) subnetting to get
those servers 1 in and 1 out of the dmz.
> If you do not use a dns forwarder,
you would access server 1 as 1.2.3.4
> or 1.2.3.4:80, and server 2 by 1.2.3.4:8080 where 1.2.3.4 is the ip
> address of your router. If you do use a dns forwarder, then it would be
> mydomain.com and mydomain.com:8080.
> You may be able to have a second domain name automatically forwarded to
> port 8080, that depends on the features offered by the dns forwarder.
> This arrangement may not work with all routers, that depends on the
> features offered.
>
> Stuart
My router is 5 years old, and offers port forwarding, thereby negating the
use of a server to perform that function. I doubt there'll be many these
days that don't.
As Davide stated, mod_proxy is the best way to perform this function
seamlessly. The only other alternative I can see is use of non-standard
ports for one of the servers.
Steve
| |
| Ottavio Caruso 2006-08-30, 7:38 am |
| pcplod@hotmail.co.uk wrote:
> I have a broadband connection that has a router connected to it.
>
> Therefore can I run 2 seperate PC's as Apache servers on the same ip
> address ?? thru the same router.
This has got nothing to do with Apache. If your router supports NAT it
is just a matter of mapping two outgoing ports on the router's acquired
public ip adresses to two internal ip addresses.
Example: if you had a netgear you could do this very easily from the
web configuration.
The mod_proxy solution is a bit overkill....
Ottavio
| |
| Davide Bianchi 2006-08-30, 1:39 pm |
| On 2006-08-30, Flamer <die.spam@hotmail.com> wrote:
> Can we just make it clear so we don't keep giving this guy wrong
> information, setting up a "virtual domain" and mod proxying it actually
> requires that you own this domain name and have it registered.
Not necessarily, the only thing you really need is a way to map the IP
address to a domain name, the fact that you have it registered in a public
DNS or you are using a simple hosts file is ininfluent. As long as the
client (browser) goes to the right machine with the right request header.
> I am guessing the original poster doesnt own two domains
He doesn't specify, so any guess is just a guess. The only thing he says is
that he has two servers and one IP address, and he want to be able to use
both of them throught one connection. Since he doesn't says if his router
can do NAT or if he can configure it, I assume that he want to stay clear
of that, the simplest solution at this point is Proxying from Apache.
> . I hardly think using iframes
Who talked about iFrames?
> when the son wants to create a document he also has to create a
> document to call that document on the other server too??
No, he only has to put the document in the DocumentRoot or wherever he
likes it, as long as the proxying is proxying the connection the document
will be served.
Davide
--
Yo-yo operating system = WinNT: it goes up..., it goes down..., it goes...
-- From a Slashdot.org post
| |
| Evan Platt 2006-08-30, 7:39 pm |
| On Tue, 29 Aug 2006 15:27:16 GMT, "pcplod@hotmail.co.uk" <pcplod>
wrote:
>I have a broadband connection that has a router connected to it.
>
>I run 2 computers, one as just a computer, the other as an Apache
>server. My son uses another PC just as a computer.
>
>My son now wants his own server, and learn more about setting up and
>running his own.
>
>Therefore can I run 2 seperate PC's as Apache servers on the same ip
>address ?? thru the same router.
With a little DNS tweaking - yes.
So on my home setup, I use a dynamic IP. Therefore I have a dyndns.org
hostname (myname.dyndns.org) . the DNS record for my domain
(www.mydomain.com ) goes to myname.dyndns.org.
I hosted another site, www.someotherdomain.com, and they did the same
thing - point their dns to myname.dyndns.org.
In my httpd.conf, I have
<VirtualHost *:80>
ServerName www.mydomain.com
DocumentRoot /Library/WebServer/Documents
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-agent}i\"" combined
CustomLog /var/log/httpd/access_log combined
</VirtualHost>
<VirtualHost *:80>
ServerName www.someotherdomain.com
ServerAlias someotherdomain.com
DocumentRoot /Users/whatnot/public_html
CustomLog /Users/whatnot/logs/satish-access_log combined
Options Indexes FollowSymLinks +ExecCGI
</VirtualHost>
Evan
|
|
|
|
|