![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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. |
|
||||
|
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.
|
|
||||
|
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. |
|
||||
|
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.
|
|
||||
|
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> 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 |
|
||||
|
Sweet I'll try that out when I get a chance, but what does "^/(.*)$" mean?
|
| Sponsored Links | ||
|
|