Update based on Viktor's feedback, 1, move to seperate class; 2, restart the server when user update publish dir; 3, remove DDLog; 4, Let kernel pick a port if default one is taken.