logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Proxy help
Author
smegsly



Joined: 17 Jul 2014
Posts: 1
Location: Canada, Ottawa

PostPosted: Thu 17 Jul '14 15:53    Post subject: Proxy help Reply with quote

Hello. I am looking for help to setup a gateway (reverse proxy I guess?), specifically how to configure Apache to point to different webservers depending on domain name.

I currently have a single webserver running multiple virtual domains all accessible via a single external IP address.

I would like to break this into 2 servers each running multiple virtual domains accessible via gateway with a singe external IP address.

As an example, a single internet IP address points to port 80 on the gateway machine. The gateway machine will determine if its example1.com, example2.com, example3.com or example4.com. If its example1.com or example2.com it will direct internally to webserver1 and if its example3.com or example4.com it will direct internally to webserver2.

Webserver1 and webserver2 each host different websites via virtual hosts.

Is this possible and if so, what is the correct configuration of the gateway machine. I currently have installed apache2 with mod_proxy enabled, but I am struggling with configuring it properly.

Thanks for your help.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Fri 18 Jul '14 16:14    Post subject: Reply with quote

my snippet

Code:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so

<VirtualHost *:80>
    ServerName example1.com
   ServerAlias www.example1.com example2.com www.example2.com
    <Location />
        ProxyPass http://Webserver1/
        ProxyPassReverse http://Webserver1/
    </Location>
</virtualhost>

<VirtualHost *:80>
    ServerName example3.com
   ServerAlias www.example3.com example4.com www.example4.com
    <Location />
        ProxyPass http://Webserver2/
        ProxyPassReverse http://Webserver2/
    </Location>
</virtualhost>
Back to top


Reply to topic   Topic: Proxy help View previous topic :: View next topic
Post new topic   Forum Index -> Apache