0276.html 5.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Host Your Own Internet Speed Tester With LibreSpeed</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Linux,Debian,LibreSpeed,Speed Test,Self-Hosted,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Host Your Own Internet Speed Tester With LibreSpeed">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="05/28/2022 07:07:37 AM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Host Your Own Internet Speed Tester With LibreSpeed</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>Basic Installation</h2>
  26. <ol>
  27. <li>Log into the Debian/Ubuntu device</li>
  28. <li>Run the following commands in a terminal:<br />
  29. <code class="codeBlock"># update repositories and install any available software updates<br />
  30. sudo apt&nbsp;update<br />
  31. sudo apt&nbsp;upgrade<br />
  32. # install Apache HTTPD, PHP and GIT<br />
  33. sudo apt&nbsp;install git apache2 php libapache2-mod-php<br />
  34. # clone the git repo<br />
  35. sudo git clone https://github.com/adolfintel/speedtest /var/www/html/speedtest<br />
  36. sudo cp /var/www/html/speedtest/example-singleServer-gauges.html /var/www/html/speedtest/index.html<br />
  37. # set the owner of the new speedtest directory to www-data<br />
  38. sudo chown -R www-data:www-data /var/www/html/speedtest</code></li>
  39. <li>Open a web browser and navigate to http://DNSorIP/speedtest</li>
  40. <li>The basic speed test functionality will be available, but it lacks the abillity to save and share speed test results. Let&#39;s add a database to enable those features</li>
  41. </ol>
  42. <h2>Optional Advanced Installation Steps</h2>
  43. <ol>
  44. <li>Continue the installation by running&nbsp;the following commands in a terminal:<br />
  45. <code class="codeBlock"># install MySQL/MariaDB<br />
  46. sudo apt&nbsp;install mariadb-server mariadb-client&nbsp;php-mysql<br />
  47. sudo su<br />
  48. mysql_secure_installation</code></li>
  49. <li>Press Enter to login as root</li>
  50. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  51. <li>Type Y and press Enter to remove anonymous users</li>
  52. <li>Type Y and press Enter to disallow root login remotely</li>
  53. <li>Type Y and press Enter to remove the test database</li>
  54. <li>Type Y and press Enter to reload privilege tables</li>
  55. <li>Run the following command to login into MySQL: <code class="codeBlock">mysql -u root -p</code></li>
  56. <li>Authenticate with the root password set earlier</li>
  57. <li>Run the following commands to create the speedtest database and database user <code class="codeBlock">MariaDB [(none)]&gt; CREATE DATABASE speedtest;<br />
  58. MariaDB [(none)]&gt; GRANT ALL ON speedtest.* to &#39;speedtest&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;Sp33dTest!!&#39;;<br />
  59. MariaDB [(none)]&gt; FLUSH PRIVILEGES;<br />
  60. MariaDB [(none)]&gt; USE speedtest;<br />
  61. MariaDB [(none)]&gt;&nbsp;\. /var/www/html/speedtest/results/telemetry_mysql.sql<br />
  62. MariaDB [(none)]&gt; EXIT;<br />
  63. exit</code></li>
  64. <li>Continue with the following commands to setup the speedtest database<br />
  65. <code class="codeBlock"># edit telemetry_settings.php<br />
  66. sudo nano /var/www/html/speedtest/results/telemetry_settings.php</code></li>
  67. <li>Verify/change $db_type = &#39;mysql&#39;;</li>
  68. <li>Change $stats_password = &#39;P@$$w0rD&#39;;</li>
  69. <li>Change $enable_id_obfuscation = true;</li>
  70. <li>Update the Mysql Settings variables to the credentials created earlier
  71. <p>$MySql_username = &#39;speedtest&#39;;<br />
  72. $MySql_password = &#39;Sp33dTest!!&#39;;<br />
  73. $MySql_hostname = &#39;localhost&#39;;<br />
  74. $MySql_databasename = &#39;speedtest&#39;;</p>
  75. </li>
  76. <li>Press CTRL+O, Enter, CTRL+X to write the changes to telemetry_settings.php</li>
  77. <li>Continue with the following commands in terminal:<br />
  78. <code class="codeBlock"># copy an example page with telemetry enabled<br />
  79. sudo cp /var/www/html/speedtest/example-singleServer-full.html /var/www/html/speedtest/index.html<br />
  80. # restart the apache2 service to enable MySQL<br />
  81. sudo systemctl restart apache2</code></li>
  82. <li>Open a web browser and navigate to http://DNSorIP/speedtest</li>
  83. <li>This time around the speedtest results have been saved to the database and a link is provided to share the results</li>
  84. </ol>
  85. <p>More Info:&nbsp;<a href="https://github.com/librespeed/speedtest" target="_blank">https://github.com/librespeed/speedtest</a></p>
  86. </div>
  87. </div>
  88. </body>
  89. </html>