DEV Community

Cover image for Add HestiaCP statistics with Nextjs or Nodejs application! (domain.tld/vstats)
Nurul Islam Rimon
Nurul Islam Rimon

Posted on

1 1 1 1 1

Add HestiaCP statistics with Nextjs or Nodejs application! (domain.tld/vstats)

Do you want to add statistics route with your MERN applications?

  • If you didn't setup Hestiacp then Click here to see installation instructions.

If you already deployed the app with HestiaCP. Now open your domain to setup statistics.

Follow the instruction below:

  1. Login to the panel. visit: your-ip:8083
  2. Visit "Web" menu and choose your domain.
  3. Click on the "Edit Domain" icon.

Image description

  1. Now click on "Web Statistics" option and select "awstats".
  2. Now Save this.

It will take a while to setup.
If your application handles unknown routes automatically the you should update configuration of the Nginx.

  1. Login into the hosting server using ssl as described in this article
  2. Go to the Nginx configuration file using command like:
 cd /home/bdcommerce/conf/web/demo.bdcommerce.app
Enter fullscreen mode Exit fullscreen mode
  1. Now edit nginx.conf file in nano editor. Command:
nano nginx.conf
Enter fullscreen mode Exit fullscreen mode

Note: If it's immutable unmute it. Command:

chattr -i nginx.conf
Enter fullscreen mode Exit fullscreen mode
  1. Add /vstats route between location ~ /.(?!well-known\/|file) { & location / {

Code:

location /vstats {
        alias /home/demo.bdcommerce.app/web/demo.bdcommerce.app/stats;
        index index.html;
    }
Enter fullscreen mode Exit fullscreen mode

It will be positioned like the SS below:

Image description

  1. Do the same job for nginx.ssl.conf (Repeat Point 3 & 4 at the stage)

  2. Now restart the nginx server:

sudo systemctl restart nginx
Enter fullscreen mode Exit fullscreen mode
  1. Visit your statistics route to see the statistics like: https://your-domain/vstats

Note: If it works then don't forget to make config file immutable.

Thanks,
N I Rimon

Sentry image

Make it make sense

Make sense of fixing your code with straight-forward application monitoring.

Start debugging β†’

Top comments (0)

Image of DataStax

Langflow: Simplify AI Agent Building

Connect models, vector stores, memory and other AI building blocks with the click of a button to build and deploy AI-powered agents.

Get started for free

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay