To view vnStat
graphs using the PHP web interface frontend on CentOS or RHEL, you can follow these steps:
vnStat
and vnstati
packages using the yum
or dnf
package manager:sudo yum install vnstat vnstati
or
sudo dnf install vnstat vnstati
This will install the vnStat
and vnstati
packages, which are required to generate and display vnStat
graphs.
php
package using the yum
or dnf
package manager:sudo yum install php
or
sudo dnf install php
This will install the php
package, which is required to run the PHP web interface frontend.
vnStat
PHP frontend package:wget https://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz tar xzf vnstat_php_frontend-1.5.1.tar.gz
This will download and extract the vnStat
PHP frontend package.
vnstat_php_frontend
directory to the desired location on your web server. For example:sudo cp -r vnstat_php_frontend /var/www/html
This will copy the vnstat_php_frontend
directory to the /var/www/html
directory, which is the default document root for the Apache web server on CentOS and RHEL.
config.php
file in the vnstat_php_frontend
directory to set the correct path to the vnstat
and vnstati
binaries. For example:sudo nano /var/www/html/vnstat_php_frontend/config.php
Change the following lines:
$vnstat_bin = '/usr/local/bin/vnstat'; $vnstati_bin = '/usr/local/bin/vnstati';
To the correct path on your system:
$vnstat_bin = '/usr/bin/vnstat'; $vnstati_bin = '/usr/bin/vnstati';
Save and close the file.
vnstat_php_frontend
directory on your web server. For example:http://localhost/vnstat_php_frontend
This will display the vnStat
PHP frontend interface, which allows you to view vnStat
graphs for the network interfaces on your system.
Show
button .