the page cannot be displayed because an internal server error has occurred, IIS7

If you get this error
the page cannot be displayed because an internal server error has occurred
most possible source of error would be something is wrong on your web.config settings.

here are two causes I found in two different instances that seem to have solved the problem.

Case 1:
In case 1 i had to remove the configSections, httpModules, httpHandler nodes all together from the system.web node.

Case 2:
In case 2 i didnt have the configSections, httpModules, httpHandler nodes within the system.web node. However the defaultDocument within the system.webServer was causing the problem.
In this case i initially had it as
<defaultDocument>
<files>
<add value="Default.aspx" />
<add value="index.html" />
</files>
</defaultDocument>
Apparently the IIS 7 was throwing that error because IIS7 already had those defined for the website.
All i had to do is put a clear before adding any default document. I guess i could remove it all together as well.