Litespeed Server Config Variables

Atticus

Active Member
#1
I am setting up a load balanced Litespeed cluster and am sharing configs across all of the web servers to simplify maintain the configuration across the cluster.

While trying to do this I have come across a need to find out what server variables are offered by Litespeed. I've checked the forums and docs and either missed it or it isn't answered.

I know of $VH_ROOT and $SERVER_ROOT, but is there anything such as $HOSTNAME for the server hostname? Does anyone know of other variables, a reference, or how to add such a variable to Litespeed?

Thanks,
Atticus
 

Atticus

Active Member
#3
I'm talking about variables I can use inside httpd_config.xml, not some PHP script. Maybe I don't fully understand how Litespeed processes its config files, but I don't imagine PHP $_SERVER keys are going to be useful?
 

NiteWave

Administrator
#4
looks like only 3 variable available: SERVER_ROOT, VH_ROOT, VH_NAME
can you be more specific on how you load balance web servers.
will forward your question to other staff.
 

Atticus

Active Member
#5
The setup is fairly simple. One front-end load balancing application with three backend Litespeed web servers (and no, we're not using LSLB).

I would like to share their httpd_config.xml between the three of them so that if I ever update the listeners, virtual hosts, etc, I don't need to go update all three servers one-by-one. It doesn't appear I can include files into the main config. If that were an option, I'd just move all of the non-unique config data to a shared file and go that route. But that isn't an option. The only real part of the config that cannot be shared across all three web servers is the server name. Everything else is fine.

Being able to set <serverName>$HOSTNAME</serverName> would be incredibly beneficial.
 

NiteWave

Administrator
#9
Now I'm clear about the request.

although $HOSTNAME will be resolved, you may have other reasonable requirements in this case. for example, each backend server has different IPs, should the listeners' IP address change automatically? or you've to use 0.0.0.0 for any available IPs on that server.

assume there are 100 backend web servers in a cluster, to deploy 100 different httpd_conf.xml, I think still need a simple script to do the necessary change on a template httpd_conf.xml and replace httpd_conf.xml on each host, and fire restart signal to lsws process in the script.
 

Atticus

Active Member
#11
Now I'm clear about the request.

although $HOSTNAME will be resolved, you may have other reasonable requirements in this case. for example, each backend server has different IPs, should the listeners' IP address change automatically? or you've to use 0.0.0.0 for any available IPs on that server.

assume there are 100 backend web servers in a cluster, to deploy 100 different httpd_conf.xml, I think still need a simple script to do the necessary change on a template httpd_conf.xml and replace httpd_conf.xml on each host, and fire restart signal to lsws process in the script.
Actually, with being able to use $HOSTNAME in the config I can deploy -one- httpd_config.xml for the whole cluster. It along with individual virtual host configs are shared over NFS from a centralized pair of NFS servers.

As for applying it to each, not a problem. I have a CLI script that I can add tasks to including resetting Litespeed on each backend web server.

Litespeed has four listeners set up with various CPU mappings and virtual hosts listed under it. It is setup to, in a way, prioritize requests based on which listener it is routed to. Each listerner listens to 0.0.0.0:<port> where the port is between 8000 and 8004. Because we use this method, the config requires no further modifications other than the server name.

Pretty simplistic. Makes cloning web servers a breeze.
 

Atticus

Active Member
#12
Just a quick question, but when is the next release due out? If it's the same spacing between the previous two then it's sometime in February. So I am curious. Thanks!
 

webizen

Well-Known Member
#15
Web admin console doesn't allow empty Server Name but you can (manually) leave it blank in httpd_conf.xml file. So the feature is there but not yet make to the change log (official).
 
Top