support running on cloudfoundry

For dispatcher and reg server