MediaWiki (+ a finely tuned PHP system, because mediawiki is unusably slow without it), MySQL, and plenty of time / resources for doing the large import of enwiki (since that is what most people are interested in).
Minimal charge to cover the bandwidth and hosting costs. Any profit donate to Wikipedia Foundation.
Solves that same problem for lots of people.