I was able to log in to home page but any system page e.g. _layouts/settings.aspx threw the "Access Denied " error.
This is how i got it working :
1) Go to "Application Management" tab in Central Administration
2) Click on the "Policy of Web application " link under "Application Security" section
3) Add the following users :
- - NT AUTHORITY\local service (Full Control)
- - "Site Collection Administrator" (Full Control)