The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Apache config issue BrewDudeBob SUN Solaris 17 04-04-2008 07:12 PM
rsh to change multiple ip in multiple servers? kenshinhimura Shell Programming and Scripting 2 02-18-2008 03:04 AM
squid proxy and apache servers marcpascual UNIX for Advanced & Expert Users 0 10-04-2005 03:26 AM
Apache Config l008com UNIX for Dummies Questions & Answers 2 07-23-2002 05:54 PM
Apache Config Files Webwitch UNIX for Dummies Questions & Answers 1 08-01-2001 03:35 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-11-2003
l008com l008com is offline
Registered User
  
 

Join Date: Jun 2002
Location: Stoneham MA
Posts: 45
Apache Config> One IP, Multiple Servers

My current setup is this. I have one Mac OS X Server running connected to the internet, with just one external IP. It routes to the rest of my network through a switch. Now in apache, I use virtual hosts and run 4 different sites off this one IP. This works great. Now what I wanna try and do, if there's a way, is to offload one of my virtual hosts to a whole other local machine. So for instance, the virtual host for www.domain.com would forward (or link to) the apache server running on machine 192.168.1.9, for instance. There are a few reasons why I wanna do this. One is just for the hell of it . Another is that I wanna play around with some sites that use perl. And while they might not be that important (meaning if they get bogged down and slow, thats not much of an issue) there are two sites that mean a lot to me and I wouldn't want them to be effected. Plus I also have a few old PPC machines lying around and I'm working on loading Linux on them just for experimenting. So if there is a way I can pull this all together, it would be great.
  #2 (permalink)  
Old 09-12-2003
andyj andyj is offline
Registered User
  
 

Join Date: Jul 2003
Location: UK
Posts: 27
virtual site request goes to another local machine

I think mod_rewrite is the quick and dirty way to go at this. Set up a rewrite rule for the <directory> directive in httpd.conf so that all requests are sent to the local adress you want.
  #3 (permalink)  
Old 09-12-2003
l008com l008com is offline
Registered User
  
 

Join Date: Jun 2002
Location: Stoneham MA
Posts: 45
Will that work to "tunnel" through like that? It won't try to send users to the local IP on thier own network?
  #4 (permalink)  
Old 09-12-2003
andyj andyj is offline
Registered User
  
 

Join Date: Jul 2003
Location: UK
Posts: 27
got me there

Good point. My answer is, I dont know. But I would guess to look at at whether

i) you are using name based or IP based virtual hosts

ii) you can dummy a local DNS with entries in /etc/hosts

iii) maybe use your router to forward the requests to the right box as a last resort.
  #5 (permalink)  
Old 09-12-2003
l008com l008com is offline
Registered User
  
 

Join Date: Jun 2002
Location: Stoneham MA
Posts: 45
I'm using name based virtual hosts as I only have one IP. And I don'tsee how a router would work, you'd need a router that could pick out the domain name out of the request in teh same way a virtual host can, and forward it to a different local machine. I don't think there is a program like that. Unless Apache has something like that built in. I don't know about that rewrite thing either, does anyone else know about that? Oh you know what I just thought of,i could use mod rewrite probably to forward a domain name domain.com to domain.com:81 and jus tmap port 81 to my other machine, I bet that would work, and it wouldn't require much work from the main server.
  #6 (permalink)  
Old 09-14-2003
andyj andyj is offline
Registered User
  
 

Join Date: Jul 2003
Location: UK
Posts: 27
proxy used example

I spotted this today.... a combination of rewite and proxy to use another machine stuck on a local port as a backend server. Hope this adds more light.


Code:
<virtual host 192.168.0.3>
servername www.frontend.com
RewriteEngine On
RewriteOptions 'inherit'
RewriteRule ^/(.*)$ http://192.168.0.4:8001/$1 [proxy]
</virtual host>
will send requests to the backend on port 8001
backend config looks like:

Code:
Listen 8001
<virtual host 192.168.0.4:8001>
DocumentRoot .........
......
</virtual host>

I typed that out from O'Reilly's Apache (the horse book) B&P. Laurie. ISBN 0-596-00203-3
  #7 (permalink)  
Old 09-14-2003
l008com l008com is offline
Registered User
  
 

Join Date: Jun 2002
Location: Stoneham MA
Posts: 45
Sweet I'll try that out when I get a chance, but what does "^/(.*)$" mean?
Sponsored Links
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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



All times are GMT -4. The time now is 09:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0