[LiteSpeed] Running Go HTTP server apps

bbanelli

New Member
Greetings to all,

what would be the best practice to run Go (GoLang) application with combination of CPanel/LiteSpeed VPS? I already have app running/working (in development)...

Use case is very simple - Go handles IO/DB/computation/various and communicate with HTML5/JS served by LiteSpeed.

I would guess one should set this up via External App in LiteSpeed administration, but is there anything else that needs to be done? Is there any way CPanel could monitor such application and make sure it (re)starts in case of failure or such? Or that could be handled with LiteSpeed as well?

With my very best,

Bruno
 
I'd definitely say you'd want it setup so Litespeed essentially acts as a reverse proxy to it similar to how PHP-FPM works for example. An external app would indeed be one of the easier ways to accomplish that.

I'm pretty sure you could still use Apache includes via WHM if you'd rather do it that way and Litespeed should pick them up just as Apache would.
 
Hi Jonathan,

as far as I have tested briefly, something like this doesn't work:

ProxyPass /path/ https://localhost:<port>/path

But that doesn't seem to work.

What would be the template to enable such workflow? I started application with nohup and that seems to be OK; does setting it up in LiteSpeed requires starting at all? Since procedure is very simple - application starts and hooks its embedded web server to <port>, so basically I would require LiteSpeed to handle application in sense of start/restart/shutdown (?) and using it as reverse proxy (accessing /path/ to get to myapp:port/path actually).

Thank you in advance,

Bruno
 
Top