LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-19-2009, 09:45 PM   #1
targettl
Member
 
Registered: Sep 2009
Location: Launceston
Distribution: Kubuntu
Posts: 84

Rep: Reputation: 16
Multiple domain names on one IP address


Is it possible to have one static IP address with a NAT network forwarding each domain name to certain internal/DMZ IP addresses?
I know you can do it by port but if both websites are on port 80 can you forward to the corresponding server on the dmz.

I ask this because I noticed the website braemere.com.au had to be typed into a web browser and entering the IP which is 202.47.5.7 did not take me to the website.
 
Old 12-20-2009, 12:30 AM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Yes. What you want to look at is setting up named virutalhosts.
 
1 members found this post helpful.
Old 12-20-2009, 05:08 PM   #3
targettl
Member
 
Registered: Sep 2009
Location: Launceston
Distribution: Kubuntu
Posts: 84

Original Poster
Rep: Reputation: 16
But how can you set-up the gateway to forward the external packets to the right internal IP
 
Old 12-20-2009, 06:26 PM   #4
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by targettl View Post
But how can you set-up the gateway to forward the external packets to the right internal IP
I think I am a little lost. Are you saying that you have a single static IP address and want it so that if two different domains point to that static IP the correct webpage will display?

If that is what you are asking then yes you can do that using apache virtualhosts. It will listen on a single IP address and give the correct page by using the domain name as the lookup.

However If you are trying to host a website on two computers internally I am afraid that is beyond me as I don't have any experience doing that.
 
1 members found this post helpful.
Old 12-20-2009, 06:40 PM   #5
targettl
Member
 
Registered: Sep 2009
Location: Launceston
Distribution: Kubuntu
Posts: 84

Original Poster
Rep: Reputation: 16
Thank you that is what I am after
 
Old 12-21-2009, 12:11 AM   #6
routers
Member
 
Registered: Aug 2005
Location: Malaysia - KULMY / CNXTH
Distribution: Slackware, Fedora, FreeBSD, Sun O/S 5.10, CentOS
Posts: 780
Blog Entries: 6

Rep: Reputation: 75
Code:
But how can you set-up the gateway to forward the external packets to the right internal IP

you can have as following
Public 202.100.100.100 openport 80 fwd to (A Server)
(A Server) Internal 192.168.1.10 openport 80
(B server) Internal 192.168.1.100 openport 80

where is now apache rewrite code come into the picture
which is need to be configured inside (A Server )

this is the sample in (A Server )

Code:
<VirtualHost *:80>
        ServerName b.server.com.au
        RewriteEngine     On
        RewriteRule       ^(.*)$        http://b.server.com.au/$1 [P]
        UseCanonicalName On
        RewriteRule ^(.*)$ [L]
</VirtualHost>
...............................................
.
# note:-
# /etc/hosts must have this line "192.168.1.100 b.server.com.au" LAN Server
# which is http://b.server.com.au is located on the server 192.168.1.100

last setup all domain to point to your public ip address

you can have many more internal server all open with same port and can be access from external with diffrent domain if you this rewritecode
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
View all domain names hosted on an IP address L1nuxn00b703 Linux - Newbie 5 10-21-2009 04:09 PM
Multiple Domain Names and Vhosts Richie55 Linux - Server 3 03-13-2009 03:02 AM
single IP multiple domain names jduckett01 Linux - Networking 2 08-26-2008 08:38 PM
How to point two domain names to one IP address wwwdot Linux - Newbie 1 05-23-2006 08:10 PM
multiple domain names stuffradio Slackware 1 01-11-2006 06:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration