Having had several more weeks to work on this server, I found some more complications: if I edit the cgi files from the local network on a Windows client machine (using a text editor such as Notepad Plus), immediately thereafter, the server returns a 500 error, no matter what the #! line says.
The error doesn't happen if I telnet in (as root) to edit the files using pico.
The problem log gives a message such as "file busy-locked". (Sorry, I don't have the exact wording because I'm in a different city now!)
Could there be something funny going on with samba?
Best regards,
Jeff Nelson