Category Archives: amazon-ec2

Apache stop all incomeing request & wait till all the traffic of this server done

i am trying to write a shell script that will automatically update my server

  #!/bin/bash
   if[build_server_response=true];then

     ## STOP ALL INCOMING REQUEST/TRAFFIC ON THIS SERVER
     ## WAIT TILL ALL THE EXISTING REQUEST/TRAFFIC IS DONE 

           #DETACH FROM LOAD BALANCE R
             aws elb deregister-instances-from-load-balancer

           perform_server_update;

           #ATTACH BACK TO LOAD BALANCE R
             aws elb register-instances-with-load-balancer
   if

so how can i achieve this what are the commands for that

     ## STOP ALL INCOMING REQUEST/TRAFFIC ON THIS SERVER
     ## WAIT TILL ALL THE EXISTING REQUEST/TRAFFIC IS DONE 
     ## OR
     ## SHIFT ALL REQUEST/TRAFFIC  FROM THIS SERVER TO ANOTHER SERVER

so that none of the user get any error

i am even using sticky session of 60 seconds in it