set up initial environment, server and socket config