Multi-environment configs and running sites on different ports
You can define CRAFT_ENVIRONMENT in your index.php like so:

switch ($_SERVER['SERVER_PORT']) {
  case "8081":
    define('CRAFT_ENVIRONMENT', 'TRUNK');
    break;
  case "8082":
    define('CRAFT_ENVIRONMENT', 'BRANCH');
    break;
}


And then in general.php and db.php you can:

return array(
  '*' =&gt; array(
    ...
  ),
  'TRUNK' =&gt; array(
    ...
  ),
  'BRANCH' =&gt; array(
    ...
  )
);