LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 02-23-2007, 08:42 AM   #1
wannab3g33k
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Rep: Reputation: 0
Question Different domains on the same IP


Hi, I didn't get a response to my question in the Linux-Networking forum on this website, that's why I am posting my question here again:

Hello,

I was wondering if anybody could help me with this. I have 3 machines in my apartment running Ubuntu 6.06 LTS, CentOS 4.4 and Windows XP Pro SP2. These 3 machines are behind a single D-Link DI-604 router. This router is behind the router of the ISP who provides the broadband Internet connection (the ISP router is also in my apartment). So essentially, I have one public IP (router) and all the servers are on private IPs. I have 3 domain names and I want to host each of the 3 domains on the 3 different machines.

How do I accomplish the following situation:

www.example1.com > 192.168.0.100 (CentOS)
www.example2.com > 192.168.0.101 (Ubuntu)
www.example3.com > 192.168.0.102 (WinXP Pro)

example1.com, example2.com and example3.com ...all point to the same public IP address.

Note: I want to use port 80 for all domains.

Will this require setting up my own DNS server?

Please advise.

Thank you.
-WBG
 
Old 02-23-2007, 10:13 AM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,121

Rep: Reputation: 121Reputation: 121
The easiest way is to setup one machine as the sort of gateway for all the hosts, preferrably Linux and Apache. Then you'd use mod_rewrite to redirect the traffic from this machine to the others, all using port 80.

So basically this first machine that you forward port 80 to with apache running, you'd setup two other virtual hosts to redirect to the other two domains, an example of the virtual host would look like this:

Code:
<VirtualHost *:80>
        ServerName www.example2.com
        RewriteEngine     On
        RewriteRule       ^(.*)$        http://192.168.0.101$1  [P]
</VirtualHost>

<VirtualHost *:80>
        ServerName www.example3.com
        RewriteEngine     On
        RewriteRule       ^(.*)$        http://192.168.0.102$1  [P]
</VirtualHost>
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sub Domains & Multiple Domains (Apache) lugos Linux - Server 1 09-01-2006 10:22 PM
Slackware and domains Crobat Slackware 4 01-13-2006 10:13 PM
Multiple domains? WorldBuilder Linux - Networking 2 05-13-2005 08:51 PM
SAMBA and Domains? TheRealDeal Linux - General 4 10-14-2003 06:36 AM
Sub Domains Mag|c Slackware 0 06-23-2003 07:30 AM


All times are GMT -5. The time now is 10:01 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration