Web page http://ipaddress/admin opens up config.php

When I was tryign to access http://ipaddress/admin . It was giving me acces denies error. Then I did chmod on the admin directory.

Then If Iam trying to access http://ipaddress/admin, it directs to a blank web page (http://Ipaddress/admin/config.php)

Web page http://Ipaddress/panel/
gives an error:

Couldn’t load variables.txt?aldope=67412

freepbx version 2.5.1
asterisk 1.6

Please help.