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 blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Cloudinary image

Optimize, customize, deliver, manage and analyze your images.

Remove background in all your web images at the same time, use outpainting to expand images with matching content, remove objects via open-set object detection and fill, recolor, crop, resize... Discover these and hundreds more ways to manage your web images and videos on a scale.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay