Setup LSWS/OpenLiteSpeed to listen to a Unix Socket

avunu

New Member
#1
Hi, I'd like to set up OLS to listen to a unix socket instead of an IP port, which will then be utilized by a Cloudflare (Argo) tunnel. I poked around at possible options and tried adding this to /usr/local/lsws/conf/httpd_config.conf:
Code:
listener Unix {
  address                 uds:///tmp/lshttpd/lshttpd.sock
  secure                  0
  map                     *
}
...but service lsws restart doesn't generate any new socket at /tmp/lshttpd/lshttpd.sock.

What am I doing wrong?
 

avunu

New Member
#3
Cool docs , but yes, I'm familiar with the basic of Cloudflare tunnels and I know I'm doing things the hard way.

Setting up services on Unix sockets vs TCP/IP port sockets is an old trick to reduce latency between services running on the same Linux/Unix host. For an example, see this post on redis. With nginx, we can use listen unix:/var/www/<WPCD-Site>.sock; to make the web server "serve" HTTP over a unix socket. I'm trying to figure out the equivalent for OpenLiteSpeed.

The funny thing that I've noticed so far is that OLS creates some (presumably site/HTTP) sockets in /tmp/lshttpd/, but they're not persistent and seem to "come and go" at will. If there's any way to make these persistent, that'd be great.
 

Cold-Egg

Administrator
#4
I see. For OLS, I don't think listen on unix socket is available, only proxy, programing language, e.g. PHP able to work with the socket.
 
Top