How to resolve the errors "Apache configure failed: could not connect to database" and 'Staring Postgresql service failed'.