======How to Set up LSWS as a Load Balancer====== This example uses 3 servers: back1.litespeedtech.com with IP *.*.*.151 back2.litespeedtech.com with IP *.*.*.152 load.litespeedtech.com with IP *.*.*.153 ''back1'' and ''back2'' will act as 2 back-end nodes, and ''load'' will act as load balancer. =====Verify the 3 Servers are Working===== {{:litespeed_wiki:config:lsws-lb-1.jpg?direct|}} {{:litespeed_wiki:config:lsws-lb-2.jpg?direct|}} {{:litespeed_wiki:config:lsws-lb-3.jpg?direct|}} The 3 servers are deliberately set to display different content to distinguish them from each other. =====Create a New External App===== Create a new external app in the load balancer server. This is can be done either at server level or the vhost level. {{:litespeed_wiki:config:lsws-lb-4.jpg?direct|}} Choose **Type** ''Web Server''. {{:litespeed_wiki:config:lsws-lb-5.jpg?direct|}} Set **Name** to ''back1''. This name will be used in a later step. Set **Address** to the IP of the first backend server. {{:litespeed_wiki:config:lsws-lb-6.jpg?direct|}} Since this example has 2 back-end nodes, repeat the previous step to create a 2nd external app with name ''back2'' and its corresponding IP address. Now create another external app, with **Type** ''Load Balancer'', and set **Workers** to ''proxy::back1,proxy::back2'' (these names were created in the previous steps). {{:litespeed_wiki:config:lsws-lb-7.jpg?direct|}} {{:litespeed_wiki:config:lsws-lb-8.jpg?direct|}} There should be 3 external apps as follows: {{:litespeed_wiki:config:lsws-lb-9.jpg?direct|}} Now create a new context with **Type** ''Load Balancer'', and in this example, set **URI** to ''/'' for a full-site proxy. {{:litespeed_wiki:config:lsws-lb-10.jpg?direct|}} {{:litespeed_wiki:config:lsws-lb-11.jpg?direct|}} Since 3 servers are using 3 different domains, now add ''load.litespeedtech.com'' domain to each of the back-end nodes' listeners. {{:litespeed_wiki:config:lsws-lb-12.jpg?direct|}} Graceful restart all 3 LSWS instances. =====Verify The Load Balancer===== Access it to verify everything is working as expected. {{:litespeed_wiki:config:lsws-lb-13.jpg?direct|}} {{:litespeed_wiki:config:lsws-lb-14.jpg?direct|}} ===== This Server Solution vs. LiteSpeed Web ADC ===== Please refer to this [[https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:lslb:lsws_load_vs_adc|article]]