We are concerned with minimizing outage probability in a typical orthogonal frequency division multiplexing (OFDM)-based two-hop relaying network. With the instantaneous channel state information at the receiver of each relay, we drive the optimal relay selection scheme which is jointly with optimum power allocation policies, and can be implemented in a distributed way. Since the power allocation to each subcarrier affects the final result of relay selection, the optimal power allocation intra subcarrier pair and all-around optimal power allocation are proposed. We demonstrate that the proposed relay selection scheme achieves M orders of diversity, where M is the number of the potential relays. Simulation results verify our analytical results and show that the optimal relay selection scheme jointly with the proposed power allocation policies offer significant performance gain.