The simple answer is Yes and the OpenLayers example you have found will do exactly what you are after.
I agree with your comment regarding WFS, although do not rule it out totally as you can restrict the amount of data that is served as Features onto your OpenLayers page uses different strategies, like bounding box. What this means is that not all the 3mill lines will be served to your web page only the ones that intersect the bounding box of your OpenLayers DIV box.
Having said that if all you want is a click and get info then definitely use WMS, its performance will be significantly better than a WFS.
To point you in the right directyion (not sure if you a newbie?) look at the GeoServer docs along with the OpenGeo GeoServer and OpenLayers workshops.http://workshops.opengeo.org/
If all of this is new then I have found the simplest way to get started is ot use the OpenGeo Suite, that way you do not need to figure out how to deploy GeoServer using Tomcat or similar.
Other options could be QGIS Cloud, GIS Cloud and similar where you load the data yourself to their host cloud storage, compose and map and then either embed or share that map.
Its a good way if you do not want to manage the servers yourself
Hope this helps you to get started