How to get CSR from my configuration

If you could let me know how to generate the csr from The private key that would also be useful.