Skip to content

Hosting the Analytics on a webserver other than localhost #365

Answered by xOlanga
xOlanga asked this question in Q&A
Discussion options

You must be logged in to vote

I figured out myself and I will leave this here for other people. Here is what I did:

  1. In my script file I run I changed the IP to run analytics on like this: twitch_miner.analytics(host="0.0.0.0", port=5000, refresh=5, days_ago=7)

  2. In the AnalyticsServer.py class I changed the host to host: str = "0.0.0.0", (idk if this is needed but it didnt break it either)

  3. On my VPS I installed ufw and allowed traffic on port 5000
    sudo apt update
    sudo apt install ufw
    sudo ufw allow 5000/tcp
    sudo ufw enable

Warning: If you connect to your VPS via ssh you have to enable that port too on ufw!

  1. I looked up the IP of my VPS with curl ifconfig.me.

  2. Launch your script on the VPS. Done.

Now you can …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xOlanga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant