The load balancing is different. It is kind of HA. When my real server is down 
then Apache forward requests to my backup server and my website never down.
Excuse me, according to below diagram, is my configuration work in a real 
scenario?

The Internet ---> Apache Reverse Proxy ---> Apache Web Server 1 (IP: 1.2.3.4, 
Name: Yahoo.com)
                                                                 ---> Apache 
Web Server 2 (IP: 1.2.3.5, Name: Google.com)

My Virtual Host configuration is:

<VirtualHost *:80>
     ServerName yahoo.com
     ErrorLog /var/log/httpd/Yahoo_error_log
     TransferLog /var/log/httpd/Yahoo_access_log
     <Location "/">
         ProxyPass  http://1.2.3.4/ 
         ProxyPassReverse   http://1.2.3.4/
     </Location>
   </VirtualHost>

    <VirtualHost *:80>
     ServerName google.com
     ErrorLog /var/log/httpd/Google_error_log
     TransferLog /var/log/httpd/Google_access_log
     <Location "/">
         ProxyPass  http://1.2.3.5/ 
         ProxyPassReverse   http://1.2.3.5/
     </Location>
   </VirtualHost>





On Wednesday, March 17, 2021, 07:54:53 PM GMT+3:30, Antony Stone 
<antony.st...@apache.open.source.it> wrote: 





On Wednesday 17 March 2021 at 17:05:37, Jason Long wrote:

> Thank you.
> My VM uses port forwarding. When I browse 127.0.0.1:2080 on my host then it
> forwarded to my guest port 80.

That's neither here nor there for what we're discussing.

> > Are you suggesting that a request which *would* go to 192.168.1.4 if it
> > were turned on, should in fact go to 192.168.1.20 if 192.168.1.4 is turned
> > off?
> 
> Yes.

In that case you *are* talking about load balancing.

> My browser can't distinguish my requests and when a server is off then it
> must forwarded to other servers automatically.

https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html

> I know in a real scenario, it solved by domain name.

I do not understand that.

A reverse proxy which forwards incoming requests to various back-end servers 
based on whether they are available or not doesn't care what the names or IP 
addresses of those back-end servers are (they need to be configured into the 
reverse proxy setup, of course, but they can be totally independent of each 
other without problem).

> If my configuration is OK, then Apache accepts a request from port 80, one of
> my servers is turned off and Apache must forward it to another server.

I can only repeat myself:

https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html


Antony.

-- 
A good conversation is like a miniskirt;
short enought to retain interest,
but long enough to cover the subject.

- Celeste Headlee



                                                  Please reply to the list;
                                                        please *don't* CC me.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org

Reply via email to