use tee to redirect stream to file

Because of stream redirection it is not able to write magento.key file if ssl directory is owned by root.
One way to solve this is to use tee.