vnStat is a lightweight, command-line network traffic monitor that allows you to track the bandwidth usage of your network interface. While it’s easy to use, it might not be the most user-friendly option for everyone. That’s where the vnStat PHP web interface comes in – it provides a graphical representation of the network traffic data that vnStat collects.

Advertisement

In this article, we’ll show you how to set up the vnStat PHP web interface on CentOS and Fedora, two popular Linux distributions.

Prerequisites

Before installing vnStat, make sure that your system meets the following requirements:

Step 1: Install PHP

The vnStat PHP web interface also requires PHP. To install PHP, run the following command:

sudo dnf install php 

Step 2: Install Apache Web Server

The vnStat PHP web interface requires an Apache web server to run. To install the Apache web server on CentOS, run the following command:

sudo dnf install httpd 

Once you have installed the Apache web server and PHP, start the Apache web server by running the following command:

sudo systemctl start httpd 

To make sure that the Apache web server starts automatically after reboot, you need to enable it. You can do this by running the following command:

sudo systemctl enable httpd 

Step 3: Install vnStat PHP Web Interface

The vnStat PHP web interface is not installed by default, so we need to install it manually. To install the vnStat PHP web interface on CentOS first, download the vnStats PHP application.

wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz 

To install the vnStat PHP web interface on Fedora, run the following command:

tar -xzf vnstat_php_frontend-1.5.1.tar.gz 
mv vnstat_php_frontend-1.5.1 /var/www/html/vnstat 

Change the file permissions to Apache user.

chwon -R apache:apache /var/www/html/vnstat 
chmod -R 755 /var/www/html/vnstat 

Step 4: Configure vnStat PHP Web Interface

The vnStat PHP web interface is located in the “/var/www/html/vnstat” directory. To access it, open a web browser and go to “http://your_server_ip/vnstat”. You should see the vnStat PHP web interface.

Setup vnStat to monitor bandwidth on CentOS and RHEL

By default, the vnStat PHP web interface shows the network traffic data for the “eth0” interface. If you have multiple network interfaces or have a different name, you can change the default interface by editing the “/var/www/html/vnstat/config.php” file.

Step 5: Monitor Network Traffic with vnStat PHP Web Interface

That’s it! You now have the vnStat PHP web interface set up and ready to use. You can monitor the network traffic data in real time by accessing the web interface and viewing the various graphs and charts. You can view the network traffic data for different time periods, such as daily, weekly, monthly, and yearly. You can also view the network traffic data for specific network interfaces.

Conclusion

In conclusion, setting up the vnStat PHP web interface on CentOS and Fedora is a simple and straightforward process. It provides a user-friendly interface for monitoring network traffic, making it easier to track bandwidth usage and troubleshoot network issues. Whether you’re a system administrator, a network engineer, or a developer, the vnStat PHP web interface is a valuable tool for monitoring and optimizing your network performance.

Read our next article to Install and Configure AWStats and install Munin network monitoring Ttool on your Linux system.

Share.
Leave A Reply

Exit mobile version