Search for "BOTG" (Bitcoin Off The Grid): it's a shell script (using the openssl commandline tool), which creates a public/private key pair, and corresponding Bitcoin address and Wallet Import Format private key.
The safest way to use it is to run it offline to generate a lot of Bitcoin addresses. Save the private keys in some secure place (NOT on your website: that's a way too visible target for hackers) and make back-ups of them (just what you'd normally do with a Bitcoin wallet). You might also want to check that they work (e.g. whether they can be imported) before using the corresponding addresses. Copy the Bitcoin addresses to your website (e.g. to a table in the website database). Any time your website needs a new Bitcoin address, it can take one from the not-yet-used addresses. Just make sure that, as your website consumes more and more addresses (e.g. because people keep making new accounts) you keep making and adding new addresses.