Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Setup virtual host to look at different computer

Posted on 2006-06-20
18
Medium Priority
?
336 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
  • 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
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…
Suggested Courses

885 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