Sudden "Failed to Connect" Errors


I have a few web apps running on an OS X10.10 machine. For months the apps have run flawlessly. They are compiled in 2013r3.3.

A few weeks ago, I began to the “failed to connect on Port XXXX” error message about half the time when I tried to connect to the apps.

But when I log into the server, I can see that the web app DID launch and is running.

When I launch the app manually, I get this response in Terminal:

Use of uninitialized value $ENV{“REQUEST_METHOD”} in string eq at ./mywebapp.cgi line 250.
Status: 200
Content-Type: text/html
Date: Mon,10 Oct 2016 12:53:03 GMT
Content-Length: 1593

I’ve discovered that after one of these events occurs, I can force quit the app and then everything works on the next attempt.

A reinstall (to rule out corruption) has not cleared the problem up.

Any idea what is going on here?

Suppose that my web app – for whatever reason – doesn’t launch fast enough for Apache’s purposes. Would the cgi throw out errors like “failed to connect on Port XXXX” ?