Although it's quite old question, this solution may help other looking for similar problem.
To display the line label at center of line, you need to create another point feature at the centroid of the lineFeature. The code for this is as follows
var VectorLayer = new OpenLayers.Layer.Vector("LineVector",{displayInLayerSwitcher: false,renderers: ["Canvas", "SVG", "VML"]});
//Create line geometry
var lineString = new OpenLayers.Geometry.LineString([source,target]);
//create line feature
var lineFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Collection([lineString]));
lineFeature.style = {
strokeColor: '#ff0000',
strokeOpacity: 0.7,
strokeWidth: 2
};//after this create label feature i.e. point feature
var lableFeature = new OpenLayers.Feature.Vector(lineString.getCentroid(true));/*Important pass true parameter otherwise it will return start point as centroid*/
var length = Math.round(lineString.getLength());
lableFeature.style = {
fontFamily: "arial, monospace",
fontWeight: "bold",
fontColor: "red",
label : length +"m",
labelAlign: "tr"//set to top right
};
VectorLayer.addFeatures([lineFeature,lableFeature]);
VectorLayer.redraw();
map.addLayers([VectorLayer]);