0276.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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="i12bretro,How To,Tutorial,Linux,Debian,LibreSpeed,Speed Test,Self-Hosted">
  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. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  12. <script type="text/javascript">
  13. $(function(){
  14. $('textarea').each(function(i,e){
  15. theTextarea = $(this);
  16. theTextarea.height((theTextarea[0].scrollHeight-5) +'px');
  17. });
  18. $('li').each(function(i,e){
  19. if(!$(this).hasClass('noCheckbox')){
  20. var uuid = 'li_' + Math.floor(Math.random() * Math.floor(1000000)).toString() + '_' + i.toString();
  21. $(this).contents().wrap('<span id="'+ uuid +'"><label for="cb_'+ uuid +'"></label></span>');
  22. $(this).prepend('<input type="checkbox" class="completeBox" id="cb_' + uuid +'" rel="'+ uuid +'" />')
  23. }
  24. });
  25. $('code,div.codeBlock,textarea.codeBlock').each(function(i,e){
  26. theElement = $(this);
  27. var lines = theElement.html().split("\n");
  28. theElement.empty();
  29. for(l=0;l<lines.length;l++){
  30. if($.trim(lines[l]) != '' && $.trim(lines[l]).substr(0,1) != '#' && $.trim(lines[l]).indexOf(' #') == -1 && lines[l].substr(0, 4).toUpperCase() != 'REM '){
  31. theElement.append('<input type="image" src="images/clipboard.png" value="" class="copy-text" rel="copy_'+ i +'_'+ l +'" data-clipboard-text="'+ $.trim(lines[l].replace(/"/g, '&quot;')) +'" /><span id="copy_'+ i +'_'+ l +'">'+ lines[l] +'</span>');
  32. } else {
  33. theElement.append(lines[l]);
  34. }
  35. }
  36. });
  37. $(document).on('click','input.copy-text',function(){
  38. theButton = $(this);
  39. $('input.copy-text').attr('src','images/clipboard.png');
  40. $('span.copy-animation,span.copy-animation-ps').removeClass('copy-animation copy-animation-ps');
  41. try {
  42. if($('#'+ theButton.attr('rel')).parent('div').hasClass('PS')){
  43. $('#'+ theButton.attr('rel')).addClass('copy-animation-ps');
  44. } else if($('#'+ theButton.attr('rel')).parent('div').hasClass('CMD')){
  45. $('#'+ theButton.attr('rel')).addClass('copy-animation-cmd');
  46. } else {
  47. $('#'+ theButton.attr('rel')).addClass('copy-animation');
  48. }
  49. navigator.clipboard.writeText(theButton.data('clipboard-text').replace(/<[^>]*>?/gm, ''));
  50. theButton.attr('src','images/clipboard_active.png');
  51. } catch(err) {
  52. }
  53. return false;
  54. });
  55. $(document).on('click','input.completeBox',function(){
  56. theBox = $(this);
  57. $('#'+ theBox.attr('rel')).addClass('strikethrough');
  58. theBox.prop('disabled',true);
  59. theBox.parent('li').prevAll().each(function(i,e){
  60. theLI = $(this);
  61. if(theLI.find('input[type=checkbox]').not(':checked')){
  62. $('#'+ theLI.find('input[type=checkbox]').attr('rel')).addClass('strikethrough');
  63. theLI.find('input[type=checkbox]').prop('checked',true).prop('disabled',true);
  64. }
  65. });
  66. });
  67. if(window.self !== window.top){
  68. window.parent.$('iframe.stepsFrame').height((this['scrollingElement']['scrollHeight']+20) +'px');
  69. }
  70. });
  71. </script>
  72. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  73. </head>
  74. <body>
  75. <div id="gridContainer">
  76. <div class="topMargin"></div>
  77. <div id="listName" class="topMargin">
  78. <h1>Host Your Own Internet Speed Tester With LibreSpeed</h1>
  79. </div>
  80. <div></div>
  81. <div id="content">
  82. <h2>Basic Installation</h2>
  83. <ol>
  84. <li>Log into the Debian/Ubuntu device</li>
  85. <li>Run the following commands in a terminal:<br />
  86. <code class="codeBlock"># update repositories and install any available software updates<br />
  87. sudo apt&nbsp;update<br />
  88. sudo apt&nbsp;upgrade<br />
  89. # install Apache HTTPD, PHP and GIT<br />
  90. sudo apt&nbsp;install git apache2 php libapache2-mod-php<br />
  91. # clone the git repo<br />
  92. sudo git clone https://github.com/adolfintel/speedtest /var/www/html/speedtest<br />
  93. sudo cp /var/www/html/speedtest/example-singleServer-gauges.html /var/www/html/speedtest/index.html<br />
  94. # set the owner of the new speedtest directory to www-data<br />
  95. sudo chown -R www-data:www-data /var/www/html/speedtest</code></li>
  96. <li>Open a web browser and navigate to http://DNSorIP/speedtest</li>
  97. <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>
  98. </ol>
  99. <h2>Optional Advanced Installation Steps</h2>
  100. <ol>
  101. <li>Continue the installation by running&nbsp;the following commands in a terminal:<br />
  102. <code class="codeBlock"># install MySQL/MariaDB<br />
  103. sudo apt&nbsp;install mariadb-server mariadb-client&nbsp;php-mysql<br />
  104. sudo su<br />
  105. mysql_secure_installation</code></li>
  106. <li>Press Enter to login as root</li>
  107. <li>Type Y and press Enter to set a root password, type the password twice to confirm</li>
  108. <li>Type Y and press Enter to remove anonymous users</li>
  109. <li>Type Y and press Enter to disallow root login remotely</li>
  110. <li>Type Y and press Enter to remove the test database</li>
  111. <li>Type Y and press Enter to reload privilege tables</li>
  112. <li>Run the following command to login into MySQL: <code class="codeBlock">mysql -u root -p</code></li>
  113. <li>Authenticate with the root password set earlier</li>
  114. <li>Run the following commands to create the speedtest database and database user <code class="codeBlock">MariaDB [(none)]&gt; CREATE DATABASE speedtest;<br />
  115. MariaDB [(none)]&gt; GRANT ALL ON speedtest.* to &#39;speedtest&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;Sp33dTest!!&#39;;<br />
  116. MariaDB [(none)]&gt; FLUSH PRIVILEGES;<br />
  117. MariaDB [(none)]&gt; USE speedtest;<br />
  118. MariaDB [(none)]&gt;&nbsp;\. /var/www/html/speedtest/results/telemetry_mysql.sql<br />
  119. MariaDB [(none)]&gt; EXIT;<br />
  120. exit</code></li>
  121. <li>Continue with the following commands to setup the speedtest database<br />
  122. <code class="codeBlock"># edit telemetry_settings.php<br />
  123. sudo nano /var/www/html/speedtest/results/telemetry_settings.php</code></li>
  124. <li>Verify/change $db_type = &#39;mysql&#39;;</li>
  125. <li>Change $stats_password = &#39;P@$$w0rD&#39;;</li>
  126. <li>Change $enable_id_obfuscation = true;</li>
  127. <li>Update the Mysql Settings variables to the credentials created earlier
  128. <p>$MySql_username = &#39;speedtest&#39;;<br />
  129. $MySql_password = &#39;Sp33dTest!!&#39;;<br />
  130. $MySql_hostname = &#39;localhost&#39;;<br />
  131. $MySql_databasename = &#39;speedtest&#39;;</p>
  132. </li>
  133. <li>Press CTRL+O, Enter, CTRL+X to write the changes to telemetry_settings.php</li>
  134. <li>Continue with the following commands in terminal:<br />
  135. <code class="codeBlock"># copy an example page with telemetry enabled<br />
  136. sudo cp /var/www/html/speedtest/example-singleServer-full.html /var/www/html/speedtest/index.html<br />
  137. # restart the apache2 service to enable MySQL<br />
  138. sudo systemctl restart apache2</code></li>
  139. <li>Open a web browser and navigate to http://DNSorIP/speedtest</li>
  140. <li>This time around the speedtest results have been saved to the database and a link is provided to share the results</li>
  141. </ol>
  142. <p>More Info:&nbsp;<a href="https://github.com/librespeed/speedtest" target="_blank">https://github.com/librespeed/speedtest</a></p>
  143. </div>
  144. </div>
  145. </body>
  146. </html>