[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1190
  • Last Modified:

How to Load Balance of IIS Server by Apache httpd

Hello All,

I Need help for configure Load balancing for my  Server, I have 3 IIS Server which is working on Windows 2008 Server, I want to distrubute Load from Apache because I think I can gain more than 10000 visitors, I want to use Apache on Frontend & All IIS Server on Backend as per attached Topology,


Can anyone help me for this type of configuration,
Apache-Load-Balance.jpg
0
Nilesh Havire
Asked:
Nilesh Havire
  • 7
  • 6
3 Solutions
 
Nilesh HavireAuthor Commented:
Hi,

I am trying as per above link, but I am getting error (The request operation has failed) after changing httpd.conf in Apache below is my configuration, can you please help me

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
<VirtualHost 192.168.1.5:8888>
        ServerName www.yourcompany.com
      ServerAlias yourcompany.com

        DocumentRoot C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs

        ProxyRequests Off

        <Proxy *>
          Order deny,allow
          Allow from all
        </Proxy>

        ProxyPass / balancer://mycluster/ lbmethod=byrequests
      stickysession=BALANCEID nofailover=ON
      ProxyPassReverse / balancer://mycluster/

      BalancerMember http://OrangeCity-2:81/ route=node1
      BalancerMember http://OrangeCity-2:82 route=node2
          ProxySet lbmethod=byrequests
        </Proxy>

        <Location /balancer-manager>
          SetHandler balancer-manager
        </Location>

        <Directory "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs">
         AllowOverride AuthConfig
      </Directory>


</VirtualHost>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
AnuroopsunddCommented:
when you restart apache from command prompt can you provide the error...
0
 
Nilesh HavireAuthor Commented:
Getting below error in log file

Warning: DocumentRoot [C:/Library/WebServer/Documents] does not exist
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.5 for ServerName
[Wed Apr 11 10:15:58 2012] [notice] Child 1620: Child process is running
[Wed Apr 11 10:15:58 2012] [notice] Child 1620: Acquired the start mutex.
[Wed Apr 11 10:15:58 2012] [notice] Child 1620: Starting 64 worker threads.
[Wed Apr 11 10:15:58 2012] [notice] Child 1620: Starting thread to listen on port 8888.
[Wed Apr 11 10:17:12 2012] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Wed Apr 11 10:17:12 2012] [notice] Child 1620: Exit event signaled. Child process is ending.
[Wed Apr 11 10:17:13 2012] [notice] Child 1620: Released the start mutex
[Wed Apr 11 10:17:14 2012] [notice] Child 1620: All worker threads have exited.
[Wed Apr 11 10:17:14 2012] [notice] Child 1620: Child process is exiting
[Wed Apr 11 10:17:14 2012] [notice] Parent: Child process exited successfully.
Warning: DocumentRoot [C:/Library/WebServer/Documents] does not exist
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.5 for ServerName
[Wed Apr 11 10:17:43 2012] [notice] Apache/2.2.22 (Win32) configured -- resuming normal operations
[Wed Apr 11 10:17:43 2012] [notice] Server built: Jan 28 2012 11:16:39
[Wed Apr 11 10:17:43 2012] [notice] Parent: Created child process 3544
Warning: DocumentRoot [C:/Library/WebServer/Documents] does not exist
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.5 for ServerName
Warning: DocumentRoot [C:/Library/WebServer/Documents] does not exist
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.5 for ServerName
[Wed Apr 11 10:17:43 2012] [notice] Child 3544: Child process is running
[Wed Apr 11 10:17:43 2012] [notice] Child 3544: Acquired the start mutex.
[Wed Apr 11 10:17:43 2012] [notice] Child 3544: Starting 64 worker threads.
[Wed Apr 11 10:17:43 2012] [notice] Child 3544: Starting thread to listen on port 8888.
[Wed Apr 11 10:26:07 2012] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Wed Apr 11 10:26:07 2012] [notice] Child 3544: Exit event signaled. Child process is ending.
[Wed Apr 11 10:26:08 2012] [notice] Child 3544: Released the start mutex
[Wed Apr 11 10:26:09 2012] [notice] Child 3544: All worker threads have exited.
[Wed Apr 11 10:26:09 2012] [notice] Child 3544: Child process is exiting
[Wed Apr 11 10:26:09 2012] [notice] Parent: Child process exited successfully.
0
 
AnuroopsunddCommented:
1. can you check if somethig else is also running on port 8888
     netstat -an
2. can you change
ServerName www.yourcompany.com
to
ServerName yourcompany.com
0
 
AnuroopsunddCommented:
else try
ServerName localhost

and check if it runs..

you will require to restart apache.. after making changes...
0
 
Nilesh HavireAuthor Commented:
Same Issue yet after did localhost,  8888 is port no. of Apache
0
 
AnuroopsunddCommented:
0
 
Nilesh HavireAuthor Commented:
After doing some changes Now Apache service is running and  it's  going to IIS can you please check my httpd.conf file

<VirtualHost *:80>
    ServerName foobar
    DocumentRoot "/var/empty"

    <Proxy balancer://idp-cluster>
        BalancerMember http://192.168.1.3:81 
      BalancerMember http://192.168.1.4:80
      BalancerMember http://192.168.1.5:81
    </Proxy>

    ProxyPass /balancer !
    ProxyPass / balancer://idp-cluster/
    ProxyPassReverse / http://192.168.1.2
    ProxyPassReverse / http://192.168.1.2
   
    <Location /balancer>
        SetHandler balancer-manager
        Order Deny,Allow
        Deny from all
        Allow from 10.
    </Location>
</VirtualHost>


But it's going only to http://192.168.1.3:81  is there any extra config for distribution as per load I means 192.168.1.3 server is Good Hardware so I want to send more request here
0
 
Nilesh HavireAuthor Commented:
Hello Please Help Me

I have done this configuration but When accessing either of the IIS servers directly (bypassing the load balancer) there is no problem, but when accessed over the load balancer, errors occur. The symptoms vary from NullPointerExceptions to javascript errors. So far I have not been able to tell what causes the difference in the resulting errors.


Can you please help me
0
 
arober11Commented:
Hi

Guessing your errors are down to a lack of stickiness, in your latest config. Basically your IIS servers may only be getting a third of the data they are expecting from a client, so you need a few tweaks to ensure all requests from one client (Browser) hit a single back end server. So  you'll want to add a:  ProxySet stickysession=JSESSIONID  directive before your </proxy> line.

Another obvious issue are the ProxyPassReverse entries, replace your existing entries with a single:

 ProxyPassReverse / balancer://idp-cluster/

On the testing front you'll need multiple clients (browsers) as the stickiness will ensure you keep on hitting the same instance from your any Browser.
0
 
Nilesh HavireAuthor Commented:
When accessing either of the IIS servers directly (bypassing the load balancer) there is no problem, but when accessed over the load balancer, errors occur.  Some time user unable to login, as per my ASP.net developer he said me event cant be fired when accessed over the load balancer, looks like all traffice not passed, How I will check Log for getting exact issue
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now