If your line is GPL rather than AGPL there's Moodle.
But you do then have to have a sysadmin capable of managing an enterprise grade LAMP stack.