fix rack SERVER_NAME/SERVER_PORT in rack environment, clean unused
constants