alexandermarston / vnstat-dashboard

A responsive web UI to view network traffic statistics provided by vnStat (with support for version 2.x)
https://alexandermarston.github.io/vnstat-dashboard/
142 stars 60 forks source link

Run vnstat-dashboard locally? #48

Open bernid opened 3 years ago

bernid commented 3 years ago

Hi, I'm trying running vnstat-dashboard locally on my Ubuntu 10.20 machine. Unfortunately I have an issue:

ela@akacja:/var/www/vnstat$ composer install
Composer could not find a composer.json file in /var/www/vnstat
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

So I use command line installation from https://getcomposer.org/download/:

ela@akacja:/var/www/vnstat$ sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ela@akacja:/var/www/vnstat$ sudo php -r "if (hash_file('sha384', 'composer-setup.php') === 'c31c1e292ad7be5f49291169c0ac8f683499edddcfd4e42232982d0fd193004208a58ff6f353fde0012d35fdd72bc394') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
Installer verified
ela@akacja:/var/www/vnstat$ sudo php composer-setup.php
All settings correct for using Composer
Downloading...

Composer (version 2.0.4) successfully installed to: /var/www/vnstat/composer.phar
Use it: php composer.phar

ela@akacja:/var/www/vnstat$ sudo php -r "unlink('composer-setup.php');"
ela@akacja:/var/www/vnstat$

But after that when I run 'composer install' still receive: 'Composer could not find a composer.json file in /var/www/vnstat' What should I do to move on? Thanks in advance.

kdkasad commented 3 years ago

composer install must be run in the app/ subdirectory.

For example:

$ git clone https://github.com/alexandermarston/vnstat-dashboard.git
$ cd vnstat-dashboard/app
$ composer install