Solved

How to Load Balance of IIS Server by Apache httpd

Posted on 2012-04-10
14
888 Views
Last Modified: 2012-05-08
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
Comment
Question by:Nilesh Havire
  • 7
  • 6
14 Comments
 
LVL 17

Accepted Solution

by:
Anuroopsundd earned 334 total points
Comment Utility
0
 
LVL 17

Assisted Solution

by:Anuroopsundd
Anuroopsundd earned 334 total points
Comment Utility
0
 

Author Comment

by:Nilesh Havire
Comment Utility
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
 
LVL 17

Expert Comment

by:Anuroopsundd
Comment Utility
when you restart apache from command prompt can you provide the error...
0
 

Author Comment

by:Nilesh Havire
Comment Utility
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
 
LVL 17

Expert Comment

by:Anuroopsundd
Comment Utility
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
 
LVL 17

Expert Comment

by:Anuroopsundd
Comment Utility
else try
ServerName localhost

and check if it runs..

you will require to restart apache.. after making changes...
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:Nilesh Havire
Comment Utility
Same Issue yet after did localhost,  8888 is port no. of Apache
0
 
LVL 17

Expert Comment

by:Anuroopsundd
Comment Utility
0
 
LVL 17

Expert Comment

by:Anuroopsundd
Comment Utility
0
 

Author Comment

by:Nilesh Havire
Comment Utility
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
 

Author Comment

by:Nilesh Havire
Comment Utility
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
 
LVL 26

Assisted Solution

by:arober11
arober11 earned 166 total points
Comment Utility
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
 

Author Comment

by:Nilesh Havire
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now