Sometimes, the answer has nothing to do with SharePoint.
I'm doing trial by fire with SharePoint on a project that I inherited. Honestly, it's one of the best ways to learn.
We've been having issues with our WSS test server. It kept showing the following error in the Application Event log:
#50070: Unable to connect to the database CONFIGDB on SQLSERVER. Check the database connection information and make sure that the database server is running.
The site would go down all of the time. It would work, then not work. When it didn't work, it was the generic "Cannot connect to configuration database." We tried all of the fixes suggested online (this, this, this, and others), but nothing worked.
Usually we could connect to the config database using the SharePoint Central Admin, even if the SharePoint site is showing the "Cannot connect to the configuration database" error. Sometimes the Central Admin couldn't find the config database, but usually it worked. Very strange.
We tried changing the domain accounts used, creating new config and content databases and restoring the content, restarting a million times, etc. Nothing fixed it for good.
So, I tried an old trick: Switch the authentication to SQL Authentication. Voilà! It appears that our Active Directory and/or SQL Server connection is flaky. So, this time SharePoint wins.