This is a challenging problem to start with! A good place to start is this tutorial on pgRouting, an extension to the PostgreSQL database with PostGIS, from one of our moderators. She has other posts on the topic here.
Once you have pgRouting working (no small task!) then you might want to check out Geoserver and OpenLayers for building a web-based interface. On your way feel free to post questions back to this forum for help.