Two Hue instances on the same host

How to install and configure two instances of Hue (different versions) on the same machine?
How to separate configuration files?
Is there a way to change the installation directory to a different one?
In the configuration I know that I must change the port number on which Hue listens, database name, the path to the log file, what else should I change on the second instance to separate it?