sudo apt install apache2 php
安装git
https://blog.csdn.net/weixin_43997319/article/details/125245168
// SSL CA cert
sudo apt-get install --reinstall ca-certificates
//克隆项目
git clone https://github.com/adolfintel/speedtest.git
cd speedtest/speedtest
sudo cp -R backend example-singleServer-pretty.html *.js /var/www/html/
cd ‘/var/www/html’
ls -la
sudo mv example-singleServer-pretty.html index.html
sudo chown -R www-data *
打开浏览器输入localhost
cd speedtest/speedtest
sudo cp -R results/ /var/www/html/
cd ‘/var/www/html’
sudo chown -R www-data *
cd results/
ls -al
sudo apt install mysql-server
sudo apt install phpmyadmin
sudo mysql
alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘admin’;
flush privileges;
exit
sudo gedit telemetry_settings.php
<?php // Type of db: "mysql", "sqlite" or "postgresql" $db_type = 'mysql'; // Password to login to stats.php. Change this!!! $stats_password = 'pass123'; // If set to true, test IDs will be obfuscated to prevent users from guessing URLs of other tests $enable_id_obfuscation = true; // If set to true, IP addresses will be redacted from IP and ISP info fields, as well as the log $redact_ip_addresses = false; // Sqlite3 settings $Sqlite_db_file = '../../speedtest_telemetry.sql'; // Mysql settings $MySql_username = 'root'; $MySql_password = 'admin'; $MySql_hostname = 'localhost'; $MySql_databasename = 'speedtest'; $MySql_port = '3306'; // Postgresql settings $PostgreSql_username = 'USERNAME'; $PostgreSql_password = 'PASSWORD'; $PostgreSql_hostname = 'DB_HOSTNAME'; $PostgreSql_databasename = 'DB_NAME'; sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin 浏览器打开http://localhost/phpmyadmin 打不开网页的话 sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin 参考 https://www.shuzhiduo.com/A/WpdKvl6o5V/ 浏览器打开http://localhost/phpmyadmin输入账号root 密码admin 创建speedtest数据库 引入数据库speedtest/speedtest/results/telemetry_mysql.sql sudo cp /speedtest/speedtest/example-singleServer-full.html index.html