There was an error in ispconfig control panel
Unable to connect to mysqlAccess denied for user 'root'@'localhost' (using password: YES)
Updated the root password with the correct one. Installation of aps succesful now.
mysqld_safe --skip-grant-tables &
mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("newrootpassword") where User='root';
mysql> flush privileges;