How to change the port ownCloud is using

Problem:

You need to change the port (80, 443) which ownCloud is using to another port.

Answer:

ownCloud is served by your webserver so you need to configure the used port in the configuration of your webserver.

Apache:

nginx

Lighttpd
http://redmine.lighttpd.net/boards/2/topics/1876