# update repositories and install any available software updates sudo apt update sudo apt upgrade # install Apache HTTPD, PHP and GIT sudo apt install git apache2 php libapache2-mod-php # clone the git repo sudo git clone https://github.com/adolfintel/speedtest /var/www/html/speedtest sudo cp /var/www/html/speedtest/example-singleServer-gauges.html /var/www/html/speedtest/index.html # set the owner of the new speedtest directory to www-data sudo chown -R www-data:www-data /var/www/html/speedtest
# install MySQL/MariaDB sudo apt install mariadb-server mariadb-client php-mysql sudo su mysql_secure_installation
mysql -u root -p
MariaDB [(none)]> CREATE DATABASE speedtest; MariaDB [(none)]> GRANT ALL ON speedtest.* to 'speedtest'@'localhost' IDENTIFIED BY 'Sp33dTest!!'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> USE speedtest; MariaDB [(none)]> \. /var/www/html/speedtest/results/telemetry_mysql.sql MariaDB [(none)]> EXIT; exit
# edit telemetry_settings.php sudo nano /var/www/html/speedtest/results/telemetry_settings.php
$MySql_username = 'speedtest'; $MySql_password = 'Sp33dTest!!'; $MySql_hostname = 'localhost'; $MySql_databasename = 'speedtest';
# copy an example page with telemetry enabled sudo cp /var/www/html/speedtest/example-singleServer-full.html /var/www/html/speedtest/index.html # restart the apache2 service to enable MySQL sudo systemctl restart apache2
More Info: https://github.com/librespeed/speedtest