Prerequisites: Apache web server
STEP 1. Click on Create Load Balancer.
STEP 2. Specify a Unique Name to your Load Balancer.After that Click on Next:Assign Security Groups.
STEP 3. Assign a new or default security group for your Load Balancer. After that Click on Next:Configure Security Settings.
STEP 4. Click Next:Configure Health Check.
STEP 5. Configure Health Check same as Shown in Below Image.After that click on Next:Add EC2 Instances.
STEP 6. Select your EC2 Instance on which you want to attach a Load Balancer. After that Click on Next:Add Tags.
STEP 7. Define Key Value Of your Load Balancer. After that Click on Review and Create.
STEP 8. Review your Load Balancer Settings before Creation.After that Click on Create.
STEP 9. Now go to Load Balancer And see your first Load Balancer.
STEP 10. To check your Load Balancer is working properly just run Load Balancer DNS Name Through your Web.
How To Add Multiple Instance In Load Balancer
STEP 11. Select your Load Balancer and Click on Edit Instances.
STEP 12. Add EC2 Instance Which You Want to Attach with Load Balancer.After that Click on Save.
STEP 13. Now check the status of the new Instance,If status is InService it means that instance is Successfully Attach with the Load Balancer.
Note-: Instance status will take few minutes to change from OutOfService to InService.
Step 14. Now we can check our Load Balancer by distributing the Traffic on both instance.For this we have installed apache2 webserver on one machine and apache2 with php on another machine.
Note: Copy LoadBalancer DNS name and Run it through webpage.
Step 15. After Running DNS Through web page refreshing the page repeatedly in return which produces the load on webserver and load balancer will help us to distribute the load over the two machine