create server and agent