LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 01-23-2005, 07:25 AM   #1
Khang
Member
 
Registered: Aug 2004
Distribution: Debian, Linux 2.6
Posts: 88

Rep: Reputation: 15
Apache - serving to external hosts from a computer on my internal network


Hi, I hope I chose the right forum for this.

Here's my current setup: I have two computers - let's call them A and B - and a router exposed to the Internet. The router is configured to forward all requests on port 80 to computer B, so currently computer B is handling all webserving. Computer B is always on.

Computer A is only on when I'm using it, however I'd like this computer to be able to act as a webserver sometimes when it's switched on. Is there some way I can configure Apache on computer B to forward some requests (e.g. ones using a certain URL) to Apache on computer A, which somehow then sends the stuff back to the client through computer B again?

Or maybe that's not how it's done... But is there a way to achieve what I'm trying to describe?

Not sure if I explained that very well at all, but I hope it made sense. Can anybody explain whether this is possible, and if so how to do it?
 
Old 01-23-2005, 11:11 AM   #2
Steve Cronje
Member
 
Registered: Jan 2003
Location: Canada
Distribution: Ubuntu, Mepis, Debian
Posts: 158

Rep: Reputation: 31
Re: Apache - serving to external hosts from a computer on my internal network

Quote:
Originally posted by Khang
Hi, I hope I chose the right forum for this.

Not sure if I explained that very well at all, but I hope it made sense. Can anybody explain whether this is possible, and if so how to do it?

Here's a pointer:

I don't know too much about this, but you need to research URL-rewriting, adn possible virtual hosts, in Apache.

HTH
Steve
 
Old 01-23-2005, 02:20 PM   #3
Khang
Member
 
Registered: Aug 2004
Distribution: Debian, Linux 2.6
Posts: 88

Original Poster
Rep: Reputation: 15
Thanks for the reply.

I think I get the URL rewriting and virtual hosts stuff. I know how to configure things so that a single server serves numerous sites according to the URL requested. What I don't know is how to involve other servers on my network that cannot themselves be connected to on port 80 from the outside world (only from within my network).
 
Old 01-24-2005, 12:05 AM   #4
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
You can do it with virtualhosts + reverse proxy, here's is a sample configuration:

Code:
<VirtualHost *:80>
ServerName www.sever2.com
ProxyPass / http://server2/
ProxyPassReverse / http://server2/
</VirtualHost>
the same can be achieved with mod_rewrite
 
Old 01-24-2005, 05:10 PM   #5
Khang
Member
 
Registered: Aug 2004
Distribution: Debian, Linux 2.6
Posts: 88

Original Poster
Rep: Reputation: 15
Thanks a lot, I got it working. Just a little tip for anybody else running Debian who may stumble upon this thread having the same problem as me, you might need to alter the settings in /etc/apache2/mods-available/proxy.conf before things work as they should.

(The mods-available, mods-enabled thing is Debian-specific right? I think so).
 
  


Reply



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
apache webserver - can see from internal but not external filpee Linux - Networking 5 03-20-2005 12:31 AM
Apache virtual hosts for intranet and external site tawalker Linux - Software 12 06-25-2004 11:01 AM
how to set apache server with internal ip for external viewers overclocking Linux - Networking 2 01-26-2004 11:20 PM
mutt will only send internal emails to other users on my computer, not external addrs denning Red Hat 1 01-05-2004 08:24 AM
SuSe 7.0 not communicating with Network (internal or external) jmnovak Linux - Networking 1 02-27-2002 11:52 AM

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

All times are GMT -5. The time now is 09:18 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