Blend4Web can do most of the work for you. It exports Blender models correctly and also sets up the WebGL page. It's free and open source.
June 2020 - blend4web does not appear to support the current version of Blender (v2.82) It is not clear whether this product is even still available after it was reworked to support Maya and other environments,