導讀
speedtest作為一款在線并且可視化的網速測試工具。使用方法簡單,無需下載、安裝多余軟件,只需有瀏覽器即可。那如何搭建一個自己的web speedtest站點呢?
項目開源地址:https://github.com/adolfintel/speedtest
安裝web,php,git程序,克隆speedtest代碼,啟動服務進行基礎測試
yum install httpd php git -y
git clone https://github.com/adolfintel/speedtest.git
cd speedtest/
cp -R backend/ example-singleServer-pretty.html *.js /var/www/html/
cd /var/www/html/
mv example-singleServer-pretty.html index.html
chown -R apache *#更改當前的目錄所屬主
systemctl start httpd
http:/hostip#訪問主機ip就可以測速了
安裝數據庫,導入數據,將測試的結果保存以便后續查詢
+++++++++++
cd /root/speedtest/
cp -R results/ /var/www/html/
cd /var/www/html/
chown -R apache *
cd /var/www/html/results/
yum install mariadb-server -y
systemctl start mariadb
mysql_secure_installation
mysql -uroot -p
create database speedtest;
exit;
+++
vi telemetry_settings.php
$stats_password="admin"; //password to login to stats.php. Change this!!!
$enable_id_obfuscation=true; //if set to true, test IDs will be obfuscated to prevent users from guessing URLs of other tests
// Mysql settings
$MySql_username="root";
$MySql_password="12456";
$MySql_hostname="localhost";
$MySql_databasename="speedtest";
++++++++++++++++++++++++++++++++++++++++++++
mysql -uroot -p speedtest < telemetry_mysql.sql
cd /var/www/html/
cp ~/speedtest/example-singleServer-full.html index.html
+++
這樣測試后的有記錄,下面是登錄網站,密碼是上面($stats_password="admin";)中指定的