本文讲述在CentOS 7服务器上安装配置SpeedTest测速软件。SpeedTest网站是全球范围的测速网站,一些大型的主机商都会使用它来测试速度。在某些时候,我们的服务器也要进行测试。当然要是在Linux桌面下可以使用speedtest-cli来达到目的。
1.安装Apache和PHP
首先登陆到云主机CentOS 7上,然后执行命令,安装Apache:
yum install httpd -y
接下来,安装相关的组件:
yum install php php-mysql php-gd php-mcrypt -y
2.下载SpeedTest Mini
目前SpeedTest Mini很难下载到,都是以前保存在电脑上下载过的,如果你没有下载过SpeedTest Mini的软件包在硬盘里,你可以通过SpeedTest Mini官方页面申请获得mini.zip包,当然还可以从网络搜索上下载mini.zip。
3.解压mini.zip
然后解压安装包,并放在apache的web目录下:
unzip mini.zip
mkdir -p /var/www/html
cp -rRfv mini /var/www/html/
4.执行完成上述命令后,我们来修改speedtest的代码文件
cd /var/www/html/mini
mv index-php.html index.html
5.启动Tomcat
执行命令,启动tomcat:
systemctl start httpd
6.访问测试页面
使用浏览器,打开服务器IP/mini页面,就可以看到SpeedTest的测试页面了:
附:在Linux终端中还可以使用speedtest-cli。安装方法:
1.pip / easy_install
pip install speedtest-cli
or
easy_install speedtest-cli
2.Github:
pip install git+https://github.com/sivel/speedtest-cli.git
or
git clone https://github.com/sivel/speedtest-cli.git
python speedtest-cli/setup.py install
3.Just download (Like the way it used to be):
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli
or
curl -Lo speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli
speedtest-cli具体使用方法请参考如何在Linux的终端测试网速一文:https://ywnz.com/linuxjc/1371.html
相关主题