In order to get the optimal voltage output from the generator, you need to re-wire the windings of the stator. I used the instructions from this website:
They are using the motor for a wind generator, but the idea for the bike is the same. I had a 42 pole stator and rewired it in 3 phases of 7 groups of 2 poles for a 24v configuration. I know that sounds kind of confusing, but read the website carefully, it's very informative and isn't too hard to follow once you get the basic concepts down.
Before reattaching the stator to the shaft housing, I cut the shaft off 2 1/4" from the housing, or about 10 1/2" overall. Next I fitted the chainring cassette over the cut end of the shaft. The ID of the cassette was slightly smaller than the OD of my motor shaft, so I had to machine it down a little bit. If you know anybody with a metal lathe, take it to them, but the method I used also works in a pinch. I clamped the shaft housing in my bench vise and put my electric drill on the threaded end. While the shaft was spinning I was able to evenly grind down the diameter of the cut end of the shaft with an angle grinder. Sorry I didn't get a photo of this.