本帖最后由 跞跞 于 2020-10-17 16:12 编辑
纯折腾。
虽然我知道更简单的方法是弄个docker,然后输入命令:linuxserver/librespeed:latest docker pulllinuxserver/librespeed dockerrun --restart=always -d -p 9988:80linuxserver/librespeed 就能建立测速服务容器了:
但感觉Docker有损耗,多一层Nat大概?反正就是折腾。
——————————————————————————————————
然后就想直接在openwrt上搭建Nginx+PHP,把测速网站扔进去。也可以扔个其他网站之类的。
回到个测速服务器搭建。亲测,Mtk7261,Arm,x86可用,下面开始了。
首先SSH输入命令(opkg源地址不好的要换一个能用的要不更新不了。末尾放写源地址):全部安完,会占用3.1MB Flash空间。
1.
opkg update
opkg install php7-fpm php7-mod-openssl php7-mod-ctype nginx --force-checksum
2.
安装完后进入/etc/nginx/conf.d/目录,删除_redirect2ssl.conf文件。
然后在该目录新建一个xxx.conf,粘贴以下文字:
server {
listen 5555;
#server_name example.com;
# location / { … } # root location for this server.
root /www/;
location / {
index index.php index.html index.htm;
}
location ~\.php$ {
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php7-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
#client_max_body_size 2048m;
}
}
3.
进入目录/www,新建一个文件夹。我是建的名字是sp。把压缩包东西拖进去。
4.
重启reboot路由器。
进入 http://路由器ip:5555/sp就能看见测速页面了。
完工。
————————————————
所以直接安比docker会快一些。
还有我这个nanopi r2s,要是安上armbian系统,跑测速,能跑满。
openwrt跑不满,不知道是php和php-fpm效率不同问题,还是openwrt得overlay系统构架问题。
跑download的时候会用到openssl生成随机数,所以也有CPU的消耗。难道是Openwrt的生成随机数效率低?
Openwrt会到80%-95%的CPU占用率。用armbian跑消耗CPU不到20%,带宽能跑满:
————————————————————————
以后再折腾吧,凑合着用。
源地址2020/10/17日这个时间节点:自行替换域名。
腾讯(推荐):
- src/gz openwrt_core https://mirrors.cloud.tencent.com/lede/snapshots/targets/x86/64/packages
- src/gz openwrt_base https://mirrors.cloud.tencent.com/lede/snapshots/packages/x86_64/base
- src/gz openwrt_diy https://mirrors.cloud.tencent.com/lede/snapshots/packages/x86_64/diy
- src/gz openwrt_freifunk https://mirrors.cloud.tencent.com/lede/snapshots/packages/x86_64/freifunk
- src/gz openwrt_helloworld https://mirrors.cloud.tencent.com/lede/snapshots/packages/x86_64/helloworld
- src/gz openwrt_luci https://mirrors.cloud.tencent.com/lede/releases/18.06.8/packages/x86_64/luci
- src/gz openwrt_packages https://mirrors.cloud.tencent.com/lede/snapshots/packages/x86_64/packages
- src/gz openwrt_routing https://mirrors.cloud.tencent.com/lede/snapshots/packages/x86_64/routing
- src/gz openwrt_telephony https://mirrors.cloud.tencent.com/lede/snapshots/packages/x86_64/telephony
复制代码
官方:
- src/gz openwrt_core https://downloads.openwrt.org/snapshots/targets/ramips/mt7621/packages
- src/gz openwrt_base https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base
- src/gz openwrt_freifunk https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/freifunk
- src/gz openwrt_luci https://downloads.openwrt.org/releases/18.06.8/packages/mipsel_24kc/luci
- src/gz openwrt_packages https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/packages
- src/gz openwrt_routing https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/routing
- src/gz openwrt_telephony https://downloads.openwrt.org/snapshots/packages/mipsel_24kc/telephony
复制代码
中国科技大学(不太好用的样子,服务器查询显示在日本):
- src/gz openwrt_core https://openwrt.proxy.ustclug.org/snapshots/targets/rockchip-rk3328/generic/packages
- src/gz openwrt_base https://openwrt.proxy.ustclug.org/snapshots/packages/aarch64_cortex-a53/base
- src/gz openwrt_helloworld https://openwrt.proxy.ustclug.org/snapshots/packages/aarch64_cortex-a53/helloworld
- src/gz openwrt_luci https://openwrt.proxy.ustclug.org/releases/18.06.8/packages/aarch64_cortex-a53/luci
- src/gz openwrt_packages https://openwrt.proxy.ustclug.org/snapshots/packages/aarch64_cortex-a53/packages
- src/gz openwrt_routing https://openwrt.proxy.ustclug.org/snapshots/packages/aarch64_cortex-a53/routing
复制代码
清华大学(已炸):
——————————————
php7全系安装:
opkg install php7 php7-cgi php7-cli php7-fastcgi php7-fpm php7-mod-bcmath php7-mod-calendar php7-mod-ctype php7-mod-curl php7-mod-dom php7-mod-exif php7-mod-fileinfo php7-mod-filter php7-mod-ftp php7-mod-gd php7-mod-gettext php7-mod-gmp php7-mod-iconv php7-mod-imap php7-mod-intl php7-mod-json php7-mod-ldap php7-mod-mbstring --force-checksum
opkg install php7-mod-mysqli php7-mod-mysqlnd php7-mod-opcache php7-mod-openssl php7-mod-pcntl php7-mod-pdo php7-mod-pdo-mysql php7-mod-pdo-pgsql php7-mod-pdo-sqlite php7-mod-pgsql php7-mod-phar php7-mod-session php7-mod-shmop php7-mod-simplexml php7-mod-snmp php7-mod-soap php7-mod-sockets php7-mod-sqlite3 php7-mod-sysvmsg --force-checksum
opkg install php7-mod-sysvsem php7-mod-sysvshm php7-mod-tokenizer php7-mod-xml php7-mod-xmlreader php7-mod-xmlwriter php7-mod-zip php7-pecl-dio php7-pecl-http php7-pecl-krb5 php7-pecl-libevent php7-pecl-mcrypt php7-pecl-propro php7-pecl-raphf php7-pecl-redis --force-checksum
——————————
php7-mod全系安装:
opkg install php7-mod-bcmath php7-mod-calendar php7-mod-ctype php7-mod-curl php7-mod-dom php7-mod-exif php7-mod-fileinfo php7-mod-filter php7-mod-ftp php7-mod-gd php7-mod-gettext php7-mod-gmp php7-mod-iconv php7-mod-imap php7-mod-intl php7-mod-json php7-mod-ldap php7-mod-mbstring php7-mod-mysqli php7-mod-mysqlnd php7-mod-opcache php7-mod-openssl php7-mod-pcntl php7-mod-pdo php7-mod-pdo-mysql php7-mod-pdo-pgsql --force-checksum
opkg install php7-mod-pdo-sqlite php7-mod-pgsql php7-mod-phar php7-mod-session php7-mod-shmop php7-mod-simplexml php7-mod-snmp php7-mod-soap php7-mod-sockets php7-mod-sqlite3 php7-mod-sysvmsg php7-mod-sysvsem php7-mod-sysvshm php7-mod-tokenizer php7-mod-xml php7-mod-xmlreader php7-mod-xmlwriter php7-mod-zip --force-checksum
——————————————————————————————————————————————测速附件:
这个就能用:
测速html发布地址:librespeed/speedtest Github: https://github.com/librespeed/speedtest
拷贝出来放服务器目录,就能测速。有用:html文件,js文件,backend文件夹。其他文件编译用的。
下面这个是Github上的,有其它一堆html,我都不太用:
https://wws.lanzous.com/b01np434b
密码:em5c
|