Two Hue instances on the same host

Hello.
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?