Moving certificate generation to the rails app

Problem was that we first cant guarantee there is a current and then if
we do assume that, the path was wrong. This should solve the certificate
problem which was causing apache to not restart properly