Setting up P2Pool on Mac

I am trying to setup Litecoin mining using Litecoin Core, P2Pool and cgminer on a Mac.

The litecoin.conf file looks like this:

rpcuser=<hidden>
rpcpassword=<hidden>
server=1
rpcport=10332
port=10333
rcpallowip=127.0.0.1

The p2pool command I used is:

python2 run_p2pool.py --net litecoin <username> <password> --bitcoind-rpc-port 10332

However, the result I get is unsuccessful:

2017-09-02 15:41:00.348882 p2pool (version 17.0-4-g68f653f)
2017-09-02 15:41:00.348925 
2017-09-02 15:41:00.348969 Testing bitcoind RPC connection to 'http://127.0.0.1:10332/' with username 'xxxxxx'...
2017-09-02 15:41:00.351799 >     Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!
2017-09-02 15:41:01.354071 >     Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!
2017-09-02 15:41:02.355983 >     Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!
2017-09-02 15:41:03.359421 >     Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!

But if I set the port to 10333, the output is like this:

2017-09-02 15:41:57.779485 p2pool (version 17.0-4-g68f653f)
2017-09-02 15:41:57.779529 
2017-09-02 15:41:57.779558 Testing bitcoind RPC connection to 'http://127.0.0.1:10333/' with username 'xxxx'...
Error while checking Bitcoin connection:
Traceback (most recent call last):
Failure: twisted.internet.error.ConnectionDone: Connection was closed cleanly.

Error while checking Bitcoin connection:
Traceback (most recent call last):
Failure: twisted.internet.error.ConnectionDone: Connection was closed cleanly.

Error while checking Bitcoin connection:
Traceback (most recent call last):
Failure: twisted.internet.error.ConnectionDone: Connection was closed cleanly.

Can someone please let me know what is the difference between the two ports? rpcport and port? Which one I shall use?

Although what is wrong with my settings?

Thank you very much.

Change your ports to api-port 9333 and port 9332 for litecoin…you only need to put 10332 and 10333 when running bitcoin on the same network…so you can just list it like this: Api-port-allow 9332 port 9332 api-port-allow-port 10332 pot 10333…
You also need to enable port forwarding to port 9327 on the the IP address of the machine you have running your litcoind server on your router

Many thanks for your reply. Do you mean I should put these lines in the litecoin.conf file?

api-port-allow=9332 
port=9332 
api-port-allow=10332 
port=10333

Yes exactly…tjen ssh to your router and enable port forwarding of port 9327 to your litecoins server…the readme in p2pool folder should have this info

I like this