Both are widely available in health food stores, including online stores, as "herbal teas." A brand that I am familiar with is Alvita,
Only registered users can see links on this board! Get registered or login!.
You can also buy sarsaparilla, wild cherry bark, licorice root and ginger root, all of which have been used in some rootbeer formulations.
Another brand that I am familiar with is Dr. Michael's Herbs in Chicago. I don't think this brand is available online, but they used to have a very large selection in their Chicago store.