内网搭建speedtest测速工具
开源代码https://github.com/librespeed/speedtest
搭建教程:
https://zhuanlan.zhihu.com/p/500402001 https://zhuanlan.zhihu.com/p/501218706?utm_id=0
宝塔官网https://www.bt.cn
一、实验环境
准备一台CentOS7系统服务器,开启root SSH远程登录。
二、操作步骤
1.宝塔Linux面板7.9.0安装
使用宝塔官网的Centos安装脚本
yum install -y wget && wget -O install.sh https://download.bt.cn/install/install_6.0.sh && sh install.sh ed8484bec
安装成功会出现以下提示
Congratulations! Installed successfully!
外网面板地址: http://1.1.1.1:8888/1a93ccbe
内网面板地址: http://2.2.2.2:8888/1a93ccbe
username: 9ouxxlor
password: 2859fbf7
If you cannot access the panel,
release the following panel port [8888] in the security group
若无法访问面板,请检查防火墙/安全组是否有放行面板[8888]端口
2.安装必要的套件
Nginx、Mysql、PHP和phpMyAdmin
3.添加站点
4.speedtest文件下载
https://github.com/librespeed/speedtest
5.上传speedtest文件
在文件/www/wwwroot/www.testtest.com(上传的目录就是新增站点的目录)
再解压
6.访问测速网站
http://www.testtest.com:65443/speedtest-master/example-singleServer-full.html
这里访问路径根据html所在的文件路劲填写
7.界面优化一下
example-singleServer-full.html名称改为speedtest.html
LibreSpeed Example改为内网测速平台speedtest
效果
8.测速信息与数据库对接
导入数据库telemetry_mysql.sql(这个sql文件在github下载的包里面有),修改telemetry_settings.php(在文件在之前上传到站点目录里面有)信息
9.登录phpMyAdmin管理数据库的工具
10.测速测试
测试查看数据库,测试客户端的网速信息,数据库中已经有了。
通过docker部署speedtest测速平台
1、安装docker
2、拉取镜像
- 在有网的情况下可以直接执行docker run命令会自动拉取并运行容器
- 如果是在内网则可以,下载镜像后导入
在网上冲浪发现有连个镜像比较好用,如下:
镜像1:https://hub.docker.com/r/openspeedtest/latest#!
docker pull openspeedtest/latest
镜像2:https://hub.docker.com/r/ilemonrain/html5-speedtest/#!
docker pull ilemonrain/html5-speedtest
3、运行容器
使用命令:
docker run [-t/-d] -p [6688]:80 ilemonrain/html5-speedtest:alpine
参数详解:
-t:启动后显示日志,可用Ctrl+C转入后台运行
-d:后台模式启动
-p 6688:80:镜像映射端口,修改6688为任意端口即可
示例命令:
docker run -d -p 6688:80 ilemonrain/html5-speedtest:alpine
OpenSNN开源社区: 在误删文件前也没有新建任何文件夹,可在第8步并没有看到被删除的文件,
CSDN-Ada助手: 非常棒的博客!感谢分享Docker中搭建FTP服务器的经验。我们期待看到更多关于Docker的技术博客。作为进一步学习和探索Docker的推荐,我们建议您写一篇博客,介绍如何在Docker中安装和使用Nginx服务器。期待您的新作品! 2023年博客之星「城市赛道」年中评选已开启(https://activity.csdn.net/creatActivity?id=10470&utm_source=blog_comment_city ), 博主的原力值在所在城市已经名列前茅,持续创作就有机会成为所在城市的 TOP1 博主(https://bbs.csdn.net/forums/blogstar2023?typeId=3152981&utm_source=blog_comment_city),更有丰厚奖品等你来拿~。
黄金大师傅: 估计是你的磁盘上的数据已经被覆盖过了
JUST_DOING_GOD: 大佬,为啥我用testdisk恢复的文件没有内容啊
zrover126: 运行后提示错误:D:\Anaconda3\python.exe C:/Users/root/PycharmProjects/pythonProject6/单线程.py Traceback (most recent call last): File "C:/Users/root/PycharmProjects/pythonProject6/单线程.py", line 14, in <module> username = line.split(",")[1] IndexError: list index out of range