For many years (20+), I have been developing and hosting web sites and web apps on various web servers running Apache with a number of virtual hosts. I have always used Perl for backend work (mysql/security etc). So one of my apps/sites might have a 100 or more Perl script in a /cgi directory that get called from javascript on the client in order to populate the browser page - usually via ajax.
Perl is no longer as useful as it once was, support and libraries are not so common, so it became clear I needed to change. I looked at other scripts - Python etc - but realised after researching a few that Go would be a great language to switch over to. I spent some time learning it and growing to appreciate all its qualities.
But when it came to using it as a replacement for Perl, it very soon became obvious that it wasn’t to be a straight swap. Writing dozens of Go apps for a website is obviously not the way to go. Most of the articles I found were talking about Go being used to write servers running on a different port with a mux and various handlers for the various ajax calls - and not to be called from Apache. My sites/apps make heavy use of js/css/scss and some frameworks (Bootstrap etc)
So, I get that idea - I need a Go app (server/daemon) to listen for all calls on a different port - say 8080 - then do the backend work, and then deliver the results back to the client.
This is where I am struggling to understand the way to proceed …
If I have many virtual hosts managed by Apache, do I need to be running one Go server app (daemon) for each site/app that I am hosting … and each one listening on a different port (8080, 8081, 8082 … etc) …
I have spent so much time searching for guidance/answers … but not found a single reference to this situation - every article I found talks about a Go server/daemon. Can anyone point me in the right direction, please?