?
Solved

Setup virtual host to look at different computer

Posted on 2006-06-20
18
Medium Priority
?
332 Views
Last Modified: 2013-11-15
I might be going about this the wrong way, but....

Is there a way to setup a virtual host to grab documents from another web server?

So, I have the address popcorn.hopto.org, and when that address is given, then apache should get the documents at 192.168.0.101, but I do not want a redirect (it is impossible since the other computer is only visible on the local network).

All other virtual hosts should look at the same (default) document folder though.
0
Comment
Question by:thaimin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
  • 6
18 Comments
 
LVL 15

Assisted Solution

by:periwinkle
periwinkle earned 100 total points
ID: 16954280
I believe that you need to look into mod_proxy - see:

http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
0
 
LVL 1

Author Comment

by:thaimin
ID: 16957016
okay......so i kind of looked that over, can you give me any help on setting it up? I'm not very good with apache (I use an XAMPP distribution). I know about editing the HTTPD.conf file, i really dont know how, but I'm guessing all the directives they are talking about go in there.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16959289
I'm sorry - I don't really have much experience with mod_proxy, but wanted to point you in the right direction... hopefully someone else will chime in!
0
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 
LVL 6

Accepted Solution

by:
philjones85 earned 900 total points
ID: 16959794
actually, i just did this.

the external machine is setup with apache with the following virtual hosts

<VirtualHost *:80>
    ServerAdmin xxx@yyy.com
    DocumentRoot "/var/www/html"
    ServerName xxx.yyy.com
    ErrorLog logs/error_log
    CustomLog logs/access_log combined
</VirtualHost>

<VirtualHost *:80>
        ServerAdmin xxx@yyy.com
        ServerName aaa.yyy.com
        CustomLog logs/aaa.yyy.com-combined_log combined
        ProxyPreserveHost On
        ProxyPass / http://192.168.0.2:80/
</VirtualHost>

<VirtualHost *:80>
        ServerAdmin xxx@yyy.com
        ServerName bbb.yyy.com
        CustomLog logs/bbb.yyy.com-combined_log combined
        ProxyPreserveHost On
        ProxyPass / http://192.168.0.3:80/
</VirtualHost>

<VirtualHost *:80>
        ServerAdmin xxx@yyy.com
        ServerName ccc.yyy.com
        CustomLog logs/ccc.yyy.com-combined_log combined
        ProxyPreserveHost On
        ProxyPass / http://192.168.0.4:80/
</VirtualHost>


----------------------------------------

then setup the internal server(s) normally.  the ProxyPreserveHost On option will pass through the domain request so you can run Virtual Hosts on the internal servers as well.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16960157
Thanks, Phil - Glad someone was there to step in with experience!
0
 
LVL 6

Expert Comment

by:philjones85
ID: 16960220
that's what we're here for, i figured that out with help from other on this site too,  let's just hope it helped and i didn't forget anything...
0
 
LVL 1

Author Comment

by:thaimin
ID: 16965334
Okay, it works very nicely, and even has taught me how to setup normal virutal hosts.

I have one more question. Is it possible to use the proxy to look at a directory of an internal serval? This what I tried:

#RPA (proxy)
<VirtualHost *:80>
    ServerAdmin xxx@yyy.com
    ServerName rpa.hopto.org
    CustomLog logs/rpa-combined_log combined
    ProxyPreserveHost On
    ProxyPass / http://192.168.0.100:80/rpa
</VirtualHost>

Basically, I want it when you go to http://rpa.hopto.org/ it to read from http://192.168.0.100:80/rpa. What ends up happening though is that it redirects the page to http://rpa.hopto.org/rpa/ and displays "The Object cannot be found"
0
 
LVL 6

Expert Comment

by:philjones85
ID: 16965449
i don't think it possible because of the nature of what you're trying to do.  an http request comes in like
GET /somefile.html HTTP/1.1
Host: somehost.com

when your external server gets it, it passes it to 192.168.0.100.  the problem is, when the internal server gets it, it takes the HOST and the REQUEST and adds them together as "somehost.com/somefile.html"

the 192.168.0.100 isn't part of the http request, its just a location to pass the request onto.

that's my 2 cents anyway

0
 
LVL 1

Author Comment

by:thaimin
ID: 16965526
well, thanks anyways. i didnt really need that part necessarily. thanks for all of the other help.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16968348
I'm glad that things are progressing for you - thanks for the kind assist - Phil really did most of the work!
0
 
LVL 6

Expert Comment

by:philjones85
ID: 16968368
its all good, i'd only be upset if it was the last day of the month and the points he gave you cost me my free membership :)

funny thing about us computer nerds, we actually enjoy helping others...
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16968482
lol - true, true, it's not about the points, is it. ;)
0
 
LVL 1

Author Comment

by:thaimin
ID: 16970651
well, you did help. phil didnt tell me i had to include all the modules for the proxy pages, and the website you gave me, thats about the only thing i got out of it :-).
0
 
LVL 6

Expert Comment

by:philjones85
ID: 16971068
yeah, i didn't know if i had remembered everything, i did it once about a month ago.  i looked back through my httpd.conf file and that was all that stuck out to me.  

but i would looked a little harder if i could have gotten a few more points, geez...
0
 
LVL 1

Author Comment

by:thaimin
ID: 16973020
well, actually, im basically out....thats why it was so little....usually i give 500, but giving that much in the past has taken its toll
0
 
LVL 6

Expert Comment

by:philjones85
ID: 16973041
lol, i was joking.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16973048
thaimin - I think Phil was making a joke about my comments about "it's not about the points" - perhaps a smiley would have made it a little more apparent, but no negativity was meant :)
0
 
LVL 1

Author Comment

by:thaimin
ID: 16973332
oh, okay :-)
0

Featured Post

Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VM backups can be lost due to a number of reasons: accidental backup deletion, backup file corruption, disk failure, lost or stolen hardware, malicious attack, or due to some other undesired and unpredicted event. Thus, having more than one copy of …
VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question