LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-20-2003, 02:36 PM   #1
registering
Member
 
Registered: Jun 2003
Location: Florida, USA
Distribution: Drake 10.1 Download
Posts: 182

Rep: Reputation: 30
Question Design question on virtually hosting and port forwarding


Hi all,
Right now I've got a single computer that does all our webserving for us. It does this by virtually hosting 3 sites. I need to move one of these sites to an internal computer, but so its webpages can be viewed by the outside world. Thus, 3 websites: 2 on main server, 1 on computer inside LAN.

Right now, I've got the main webserver virtually hosting all 3 websites, can view the internal one internally no problem, but nobody can view it from the outside world. This is because in my /var/named/db.DOMAIN.NET, it points to 192.168.0.152, which is why everyone inside can see it, but nobody on the outside can.

This internal system must keep its 192.168.0.152 IP address and I haven't figured out how to forward anyone external trying to view WWW.DOMAIN.NET to 192.168.0.152.

Am I going about this the right way: have the main webserver host this internal domain, or should I also run named on the internal system? The problem is I can't just forward port 80 to 192.168.0.152, since the main server also hosts 2 other sites.
Any tips?? Is there a way I can point a particular directory on the main server to my other internal server? Like a link, so my main server virtually hosts DOMAIN.NET and points to directory /var/internal-server, and /var/internal-server points to 192.168.0.152??

Last edited by registering; 08-20-2003 at 02:58 PM.
 
Old 08-20-2003, 03:49 PM   #2
bastard23
Member
 
Registered: Mar 2003
Distribution: Debian
Posts: 275

Rep: Reputation: 30
registering,

Look at the apache module mod_proxy. It will allow the main server to send the request for one virtual host to another computer.

Good Luck,
chris
 
Old 08-20-2003, 04:05 PM   #3
registering
Member
 
Registered: Jun 2003
Location: Florida, USA
Distribution: Drake 10.1 Download
Posts: 182

Original Poster
Rep: Reputation: 30
Thanks for the tip! It sounds like a reverse proxy is exactly what I was looking for.
 
Old 08-21-2003, 07:59 AM   #4
registering
Member
 
Registered: Jun 2003
Location: Florida, USA
Distribution: Drake 10.1 Download
Posts: 182

Original Poster
Rep: Reputation: 30
Okay, for some reason my name server doesn't resolve the name properly. I'm using RH 7.2 w/apache 1.3. Below are my config files. For reference, www.AAA.org is the internally hosted website I want our main webserver to proxy/virtual host. www.BBB.com is our main webserver's domain name (also virtually hosted).

I figured I could tell our name server to send all requests for AAA.org to the same location as BBB.com. The db named file for BBB.com then uses an alias of AAA.org. That means they both go to the same address, and hands off all port 80 requests to apache. Apache then proxy serves BBB.org by sending all requests for that to the internal 192.168.0.152. However all I get from traceroute is "unknown host: www.AAA.org". Where is my thinking flawed? (more than 1 answer is allowed. ).

www.BBB.com works fine, but now www.AAA.org can't even be seen internally.

..........
LoadModule proxy_module modules/libproxy.so
..........
AddModule mod_proxy.c
..........
<VirtualHost *>
ServerName www.AAA.org
DocumentRoot /var/www/html

ProxyRequests Off

ProxyPass / http://192.168.0.152
ProxyPassReverse / http://192.168.0.152

</VirtualHost>



This is what's in /etc/named.conf:

.....................
zone "BBB.com" in {
type master;
file "db.BBB.com";
};

zone "AAA.org" in {
type master;
file "db.BBB.com";
};
....................


And this is what's in /var/named/db.BBB.com:


$TTL 3h
BBB.com. IN SOA ns1.BBB.com. root.BBB.com. (
2 ; Serial
3h ; Reresh after 3 hours
1h ; Retry after 1 hour
1w ; Expire after 1 week
1h ) ; Negative caching TTL of 1 day
;
; Name servers
;
BBB.com. IN NS ns1.BBB.com.
BBB.com. IN NS ns2.BBB.com.

;
; Addresses for the canonical names
;
localhost.BBB.com. IN A 127.0.0.1
ns1.BBB.com. IN A 12.170.Y.Z0
ns2.BBB.com. IN A 12.170.Y.Z1
grandpa.BBB.com. IN A 12.170.Y.Z2

BBB.com. IN MX 1 grandpa.BBB.com.
;
; Aliases
;
mail.BBB.com. IN CNAME grandpa.BBB.com.
ftp.BBB.com. IN CNAME grandpa.BBB.com.
www.BBB.com. IN CNAME grandpa.BBB.com.
www.AAA.org. IN CNAME grandpa.BBB.com.

Last edited by registering; 08-21-2003 at 03:19 PM.
 
Old 08-22-2003, 08:04 AM   #5
registering
Member
 
Registered: Jun 2003
Location: Florida, USA
Distribution: Drake 10.1 Download
Posts: 182

Original Poster
Rep: Reputation: 30
Talking FAVOR TO ASK

Okaay, I think I found the problem. There were two of them:

1) named (at least my version) does not like 2 zones to use the same db file. I couldn't find this documented anywhere, but using identical -- but separate -- db files solved the problem

2) I forgot to add a "/" on the end of my ProxyPass command.

Changing the above SEEMS to have solved things.

Could someone please go to http://www.nerrenvirons.org and let me know if you see ANYTHING?? I can't test whether the world can see it when I'm behind our firewall (not that I know of, is there a way to do this??) Thanks for any help!
 
Old 08-22-2003, 04:35 PM   #6
bastard23
Member
 
Registered: Mar 2003
Distribution: Debian
Posts: 275

Rep: Reputation: 30
registering,

I get a three frame page titled NERR Telemetry. The left frame has home, graph, and help links. The frame in the right gives:
Warning: socket_connect() unable to connect [111]: Connection refused in /nerr/html/pages/stacked.php on line 1004
connect() failed. Reason: () Success
Unable to connect to socket


Have fun,
chris

edit: three frames left, top, right

Last edited by bastard23; 08-22-2003 at 04:37 PM.
 
  


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
Port Forwarding Question leedsmunich Linux - Networking 1 10-03-2005 09:17 AM
Port forwarding question linuxpyro Linux - Networking 3 10-22-2004 08:13 PM
Port forwarding question GUIPenguin Linux - Networking 1 10-12-2004 01:30 PM
port forwarding question larry Linux - Networking 2 06-10-2004 10:34 AM
Question about Ip/Port Forwarding Half_Elf Linux - Networking 3 10-14-2002 02:47 PM

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

All times are GMT -5. The time now is 07:41 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
Open Source Consulting | Domain Registration