user57832: I've looked for an exactly answer but I really couldn't find it.
So can someone let me know the why of doing what I'm asking correctly?

user63569: if you don't have Bitcoin-core and bitcoin cash already installed alongside, follow my answer in here to install Bitcoin-cash alongside Bitcoin-core.
It's so important creating a different username than bitcoin username because bitcoin and bitcoin cash use the same directory.
Now login to Bitcoin username and edit this file ~/.bitcoin/bitcoin.conf
so it becomes like that:
rpcuser=myusername
rpcpassword=myRPCpa$$word
daemon=1
server=1
rpcport=5345

in here we are using different RPC port to bitcoin core. to know more about bitcoin config see this website.
Now, do the same thing to Bitcoin-cash, and everything should work as it supposed to be. 
if you have a firewall enabled, don't forget to allow chosen ports.

57832: <p>I've looked for an exactly answer but I really couldn't find it.
So can someone let me know the why of doing what I'm asking correctly?</p>
 63569: <p>if you don't have Bitcoin-core and bitcoin cash already installed alongside, follow my answer in <a href="https://bitcoin.stackexchange.com/questions/70403/installing-bitcoin-and-bitcoincash-on-same-server">here</a> to install Bitcoin-cash alongside Bitcoin-core.</p>

<p><em>It's so important creating a different username than bitcoin username because bitcoin and bitcoin cash use the same directory.</em></p>

<p>Now login to Bitcoin username and edit this file <code>~/.bitcoin/bitcoin.conf</code></p>

<p>so it becomes like that:</p>

<pre><code>rpcuser=myusername
rpcpassword=myRPCpa$$word
daemon=1
server=1
rpcport=5345
</code></pre>

<p>in here we are using different RPC port to bitcoin core. to know more about bitcoin config see <a href="https://jlopp.github.io/bitcoin-core-config-generator/" rel="nofollow noreferrer">this website</a>.</p>

<p>Now, do the same thing to Bitcoin-cash, and everything should work as it supposed to be. </p>

<p>if you have a firewall enabled, don't forget to allow chosen ports.</p>
