An in-domain finite dimensional controller for a class of distributed parameter systems on a one-dimensional spatial domain formulated under the port-Hamiltonian framework is presented. Based on (Trenchant et al. 2017) where positive feedback and a late lumping approach is used, we extend the Control by Interconnection method and propose a new energy shaping methodology with an early lumping approach on the distributed spatial domain of the system. Our two main control objectives are to stabilize the closed-loop system, as well as to improve the closed-loop dynamic performances. With the early lumping approach, we investigate two cases of the controller design, the ideal case where each distributed controller acts independently on the spatial domain (fully-actuated), and the more realistic case where the control action is piecewise constant over certain intervals (under-actuated). We then analyze the asymptotic stability of the closed-loop system when the infinite dimensional plant system is connected with the finite dimensional controller. Furthermore we provide simulation results comparing the performance of the fully-actuated case and the under-actuated case with an example of an elastic vibrating string.