Renaming localhost

The only way I know of is to edit your /etc/hosts file.

So for example you could have this:

127.0.0.1 localhost marius

I'm not totally sure on changing port though, as you shouldn't use ports in the hosts file.