找回密码
 立即注册

ARMv7梅林变服务器--安装Entware php mysql 等

[复制链接]
69伙伴 发表于 2018-5-9 09:55:29 | 显示全部楼层 |阅读模式
2020年01月01日
重点:swap 需要2g至少,如果是512m比较小的话 会遇到 php mysql 无法启动红字都是重点!尤其是帖子尾

1.安装扩展
  1. entware-setup.sh
复制代码
选择1 回车之后等完成

2.安装虚拟内存
   2-1  生成wsap (生成2g的文件 虚拟内存小的话后面php mysql无法启动)

  1. dd if=/dev/zero of=/opt/.swap bs=1024k count=2048
复制代码
2-2 准备好使用 swap 设置交换文件
  1. mkswap /opt/.swap
复制代码
2-3 挂载swap
  1. swapon /opt/.swap
复制代码


3. 安装sftp服务
  1. opkg install openssh-sftp-server
复制代码
4.可选装nano 文本编辑器 比vi简单的编辑器
  1. opkg install nano
复制代码
选装 ss 这个事查端口的用的命令
  1. opkg install ss
复制代码
用法:
ss -lntpd | grep :81
旧命令 也能用
netstat -anp |grep 3306


5.增加启动项 开机挂载swap(onmp不自动启动没用)
  1. nano /jffs/scripts/post-mount
复制代码
9EADC37431A33934BFEC36B707DF6F96.jpg
增加

  1. sh /opt/69start.sh
复制代码
ctrl +x 退出nano 只是提示问你是否保存 选择y



6.在/opt/下创建 69start.sh
  1. touch /opt/69start.sh
  2. chmod 777 /opt/69start.sh
复制代码
     6-1 添加69start.sh内容
  1. nano /opt/69start.sh
复制代码


以下为内容69start.sh内容
  1. #!/bin/sh
  2. mkswap /opt/.swap
  3. swapon /opt/.swap
复制代码



=======================
7.装 php mysql 等
可以自己 手动装 比如  opkg install nginx
可以使用集成环境下面 已集成环境为例

安装onmp

  1. sh -c "$(curl -kfsSl https://raw.githubusercontent.com/xzhih/ONMP/master/oneclick.sh)"
复制代码
是否安装PHP的模块(Nextcloud这类应用需要),你也可以手动安装
输入你的选择[y/n]: y


更改mysql密码
管理:onmp open
一次旧密码 123456回车后,两次新密码(自己的)


输入你的选择[0-9]: 3
mysqld is already running
初始密码:123456
Enter password:123456
New password:(自己的)
Confirm new password:(自己的)
onmp正在重启
nginx 启动成功
php-fpm 启动成功
mysqld 启动成功
onmp已启动
网站列表:
/opt/wwwroot/default/        192.168.50.1:81
浏览器地址栏输入:192.168.50.1:81 查看php探针




管理命令
https://github.com/xzhih/ONMP
onmp nginx restart
onmp php restart
onmp mysql restart


注意:1.安装mysqladmin 在  (安装网页里)

2.mysql远程连接处错
2013  Lost connection to MySQL server at 'reading initial communication packet', system error: 2
登录mysqladmin 新建一个 用户% 给权限就可以了

3.外网wan口外网登录需要修改
  1. nano /opt/etc/mysql/my.cnf
复制代码
注掉下行,在前面添加 #
bind-address       = 127.0.0.1
变成
#bind-address       = 127.0.0.1
重启mysql 不会就重启路由


3.内存确实会用!导致跑py 跑数据库等 卡卡卡卡卡的
经过N个小时逐个的看梅林系统功能按钮。 最终找到问题了
在tools 选项下
384.jpg 3842.jpg


之后就老老实实的 用虚拟内存了
ff.jpg


重点:这个可能是 384才有的!





下也全是 旧笔记内容 无参考价值

临时交流 ⇨点我留言
 楼主| 69伙伴 发表于 2019-12-29 20:02:34 | 显示全部楼层
admin@Web-1750:/tmp/home/root# entware-setup.sh
Info:  This script will guide you through the Entware installation.
Info:  Script modifies "entware" folder only on the chosen drive,
Info:  no other data will be changed. Existing installation will be
Info:  replaced with this one. Also some start scripts will be installed,
Info:  the old ones will be saved on Entware partition with name
Info:  like /tmp/mnt/sda1/jffs_scripts_backup.tgz

Info:  Looking for available partitions...
[1] --> /tmp/mnt/sda1
=>  Please enter partition number or 0 to exit
[0-1]: 1
Info:  /tmp/mnt/sda1 selected.

* Warning:  Found previous installation, saving...
Info:  Creating /tmp/mnt/sda1/entware folder...
Info:  Creating /tmp/opt symlink...
Info:  Creating /jffs scripts backup...
tar: removing leading '/' from member names
Info:  Modifying start scripts...
Info: Checking for prerequisites and creating folders...
Warning: Folder /opt exists!
Info: Opkg package manager deployment...
--2019-12-29 17:59:40--  http://bin.entware.net/armv7sf-k2.6/installer/opkg
Resolving bin.entware.net... 2606:4700:30::681b:b032, 104.27.176.50, 104.27.177.50
Connecting to bin.entware.net|2606:4700:30::681b:b032|:80... failed: Network is unreachable.
Connecting to bin.entware.net|104.27.176.50|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 134932 (132K) [application/octet-stream]
Saving to: '/opt/bin/opkg'

/opt/bin/opkg       100%[=====================>] 131.77K   186KB/s   in 0.7s

2019-12-29 17:59:42 (186 KB/s) - '/opt/bin/opkg' saved [134932/134932]

--2019-12-29 17:59:42--  http://bin.entware.net/armv7sf-k2.6/installer/opkg.conf
Resolving bin.entware.net... 2606:4700:30::681b:b132, 104.27.177.50, 104.27.176.50
Connecting to bin.entware.net|2606:4700:30::681b:b132|:80... failed: Network is unreachable.
Connecting to bin.entware.net|104.27.177.50|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 190 [application/octet-stream]
Saving to: '/opt/etc/opkg.conf'

/opt/etc/opkg.conf  100%[=====================>]     190  --.-KB/s   in 0s

2019-12-29 17:59:43 (6.01 MB/s) - '/opt/etc/opkg.conf' saved [190/190]

--2019-12-29 17:59:43--  http://bin.entware.net/armv7sf-k2.6/installer/ld-2.23.so
Resolving bin.entware.net... 2606:4700:30::681b:b032, 104.27.176.50, 104.27.177.50
Connecting to bin.entware.net|2606:4700:30::681b:b032|:80... failed: Network is unreachable.
Connecting to bin.entware.net|104.27.176.50|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 142752 (139K) [application/octet-stream]
Saving to: '/opt/lib/ld-2.23.so'

/opt/lib/ld-2.23.so 100%[=====================>] 139.41K   190KB/s   in 0.7s

2019-12-29 17:59:44 (190 KB/s) - '/opt/lib/ld-2.23.so' saved [142752/142752]

--2019-12-29 17:59:44--  http://bin.entware.net/armv7sf-k2.6/installer/libc-2.23.so
Resolving bin.entware.net... 2606:4700:30::681b:b132, 104.27.177.50, 104.27.176.50
Connecting to bin.entware.net|2606:4700:30::681b:b132|:80... failed: Network is unreachable.
Connecting to bin.entware.net|104.27.177.50|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1215124 (1.2M) [application/octet-stream]
Saving to: '/opt/lib/libc-2.23.so'

/opt/lib/libc-2.23.  36%[======>               ] 428.53K  --.-KB/s   in 15m 4s s

2019-12-29 18:14:49 (486 B/s) - Read error at byte 438810/1215124 (Connection timed out). Retrying.

--2019-12-29 18:14:50--  (try: 2)  http://bin.entware.net/armv7sf-k2.6/installer/libc-2.23.so
Connecting to bin.entware.net|104.27.177.50|:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 1215124 (1.2M), 776314 (758K) remaining [application/octet-stream]
Saving to: '/opt/lib/libc-2.23.so'

/opt/lib/libc-2.23.  51%[+++++++===>           ] 607.48K  --.-KB/s   in 15m 2s s

2019-12-29 18:29:52 (203 B/s) - Read error at byte 622061/1215124 (Connection timed out). Retrying.

--2019-12-29 18:29:54--  (try: 3)  http://bin.entware.net/armv7sf-k2.6/installer/libc-2.23.so
Connecting to bin.entware.net|104.27.177.50|:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 1215124 (1.2M), 593063 (579K) remaining [application/octet-stream]
Saving to: '/opt/lib/libc-2.23.so'

/opt/lib/libc-2.23.  70%[+++++++++++===>       ] 832.92K  --.-KB/s   in 15m 2s s

2019-12-29 18:44:57 (256 B/s) - Read error at byte 852912/1215124 (Connection timed out). Retrying.

--2019-12-29 18:45:00--  (try: 4)  http://bin.entware.net/armv7sf-k2.6/installer/libc-2.23.so
Connecting to bin.entware.net|104.27.177.50|:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 1215124 (1.2M), 362212 (354K) remaining [application/octet-stream]
Saving to: '/opt/lib/libc-2.23.so'

/opt/lib/libc-2.23.  85%[+++++++++++++++==>    ]   1016K  --.-KB/s   in 15m 1s s

2019-12-29 19:00:02 (208 B/s) - Read error at byte 1040803/1215124 (Connection timed out). Retrying.

--2019-12-29 19:00:06--  (try: 5)  http://bin.entware.net/armv7sf-k2.6/installer/libc-2.23.so
Connecting to bin.entware.net|104.27.177.50|:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 1215124 (1.2M), 174321 (170K) remaining [application/octet-stream]
Saving to: '/opt/lib/libc-2.23.so'

/opt/lib/libc-2.23. 100%[++++++++++++++++++===>]   1.16M  74.9KB/s   in 2.3s

2019-12-29 19:00:10 (74.9 KB/s) - '/opt/lib/libc-2.23.so' saved [1215124/1215124]

--2019-12-29 19:00:10--  http://bin.entware.net/armv7sf-k2.6/installer/libgcc_s.so.1
Resolving bin.entware.net... 2606:4700:30::681b:b132, 104.27.176.50, 104.27.177.50
Connecting to bin.entware.net|2606:4700:30::681b:b132|:80... failed: Network is unreachable.
Connecting to bin.entware.net|104.27.176.50|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 45272 (44K) [application/octet-stream]
Saving to: '/opt/lib/libgcc_s.so.1'

/opt/lib/libgcc_s.s 100%[=====================>]  44.21K   118KB/s   in 0.4s

2019-12-29 19:00:12 (118 KB/s) - '/opt/lib/libgcc_s.so.1' saved [45272/45272]

--2019-12-29 19:00:12--  http://bin.entware.net/armv7sf-k2.6/installer/libpthread-2.23.so
Resolving bin.entware.net... 2606:4700:30::681b:b032, 104.27.177.50, 104.27.176.50
Connecting to bin.entware.net|2606:4700:30::681b:b032|:80... failed: Network is unreachable.
Connecting to bin.entware.net|104.27.177.50|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 92640 (90K) [application/octet-stream]
Saving to: '/opt/lib/libpthread-2.23.so'

/opt/lib/libpthread 100%[=====================>]  90.47K  90.3KB/s   in 1.0s

2019-12-29 19:00:14 (90.3 KB/s) - '/opt/lib/libpthread-2.23.so' saved [92640/92640]

Info: Basic packages installation...
Downloading http://bin.entware.net/armv7sf-k2.6/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
Installing entware-opt (227000-3) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/entware-opt_227000-3_all.ipk
Installing libgcc (7.4.0-8) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libgcc_7.4.0-8_armv7-2.6.ipk
Installing libc (2.23-8) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libc_2.23-8_armv7-2.6.ipk
Installing libssp (7.4.0-8) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libssp_7.4.0-8_armv7-2.6.ipk
Installing libpthread (2.23-8) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libpthread_2.23-8_armv7-2.6.ipk
Installing librt (2.23-8) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/librt_2.23-8_armv7-2.6.ipk
Installing libstdcpp (7.4.0-8) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libstdcpp_7.4.0-8_armv7-2.6.ipk
Installing entware-release (1.0-2) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/entware-release_1.0-2_all.ipk
Installing zoneinfo-asia (2019c-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/zoneinfo-asia_2019c-1_armv7-2.6.ipk
Installing zoneinfo-europe (2019c-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/zoneinfo-europe_2019c-1_armv7-2.6.ipk
Installing findutils (4.6.0-4) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/findutils_4.6.0-4_armv7-2.6.ipk
Installing terminfo (6.1-5) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/terminfo_6.1-5_armv7-2.6.ipk
Installing libpcre (8.43-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/libpcre_8.43-1_armv7-2.6.ipk
Installing grep (3.3-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/grep_3.3-1_armv7-2.6.ipk
Installing locales (2.23-8) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/locales_2.23-8_armv7-2.6.ipk
Installing opkg (2019-06-14-dcbc142e-2) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/opkg_2019-06-14-dcbc142e-2_armv7-2.6.ipk
Installing entware-upgrade (1.0-1) to root...
Downloading http://bin.entware.net/armv7sf-k2.6/entware-upgrade_1.0-1_all.ipk
Configuring libgcc.
Configuring libc.
Configuring libssp.
Configuring libpthread.
Configuring librt.
Configuring terminfo.
Configuring libpcre.
Configuring grep.
Configuring locales.
Entware uses separate locale-archive file independent from main system
Creating locale archive - /opt/usr/lib/locale/locale-archive
Adding en_EN.UTF-8
Adding ru_RU.UTF-8
You can download locale sources from http://bin.entware.net/other/i18n_glib223.tar.gz
You can add new locales to Entware using /opt/bin/localedef.new
Configuring entware-upgrade.
Upgrade operations are not required
Configuring opkg.
Configuring zoneinfo-europe.
Configuring zoneinfo-asia.
Configuring libstdcpp.
Configuring entware-release.
Configuring findutils.
Configuring entware-opt.
Info: Congratulations!
Info: If there are no errors above then Entware was successfully initialized.
Info: Add /opt/bin & /opt/sbin to your PATH variable
Info: Add '/opt/etc/init.d/rc.unslung start' to startup script for Entware services to start
Info: Found a Bug? Please report at https://github.com/Entware/Entware/issues
admin@Web-1750:/tmp/home/root#
临时交流 ⇨点我留言
 楼主| 69伙伴 发表于 2019-12-29 20:09:26 | 显示全部楼层

安装onmp (9成会遇到 Downloading http://bin.entware.net**** 不动了)看作者说放着去忙别的 几天过之后在看 就好了  我已经等了10个小时了 继续等
  1. sh -c "$(curl -kfsSl https://raw.githubusercontent.com/xzhih/ONMP/master/oneclick.sh)"
复制代码
更多参考
https://github.com/xzhih/ONMP

临时交流 ⇨点我留言
 楼主| 69伙伴 发表于 2019-12-29 23:45:01 | 显示全部楼层


开tls1.3


  1. server {
  2.     listen 80;
  3.     server_name uid.cool;
  4.     return 301 https://uid.cool$request_uri;
  5. }

  6. server {
  7.     listen 443 ssl http2;
  8.     server_name uid.cool;
  9.     root /wwwroot/uid.cool;

  10.     # SSL
  11.     ssl_certificate         /usr/local/nginx/conf/ssl/uid.cool.cer;
  12.     ssl_certificate_key     /usr/local/nginx/conf/ssl/uid.cool.key;

  13.     ssl_protocols TLSv1.2 TLSv1.3;
  14.     ssl_ciphers '[TLS13+AESGCM+AES128|TLS13+AESGCM+AES256|TLS13+CHACHA20]:[EECDH+ECDSA+AESGCM+AES128|EECDH+ECDSA+CHACHA20]:EECDH+ECDSA+AESGCM+AES256:EECDH+ECDSA+AES128+SHA:EECDH+ECDSA+AES256+SHA:[EECDH+aRSA+AESGCM+AES128|EECDH+aRSA+CHACHA20]:EECDH+aRSA+AESGCM+AES256:EECDH+aRSA+AES128+SHA:EECDH+aRSA+AES256+SHA:RSA+AES128+SHA:RSA+AES256+SHA:RSA+3DES';
  15.     ssl_ecdh_curve X25519:P-256:P-384;
  16.     ssl_prefer_server_ciphers on;

  17.     ssl_session_cache shared:SSL:50m;
  18.     ssl_session_timeout 1d;
  19.     ssl_session_tickets on;

  20.     # OCSP Stapling
  21.     ssl_stapling on;
  22.     ssl_stapling_verify on;
  23.     resolver 119.29.29.29 8.8.8.8 valid=300s;
  24.     resolver_timeout 10s;

  25.     # Security headers
  26.     add_header X-Frame-Options "SAMEORIGIN" always;
  27.     add_header X-XSS-Protection "1; mode=block" always;
  28.     add_header X-Content-Type-Options "nosniff" always;
  29.     add_header Referrer-Policy "no-referrer-when-downgrade" always;
  30.     add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

  31.     location / {
  32.       index  index.html;
  33.       http2_push /style.css;
  34.     }

  35.     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico)$ {
  36.       expires 30d;
  37.     }

  38.     location ~ .*\.(js|css)?$ {
  39.       expires 15d;
  40.     }
  41. }
复制代码


可以到 SSL Server Test:进行测试
https://www.ssllabs.com/ssltest/index.html


临时交流 ⇨点我留言
 楼主| 69伙伴 发表于 2019-12-30 02:13:43 | 显示全部楼层
自作Swap
  1. 安装nano 编辑器 比vi简单点
  2. opkg install nano

  3. 添加启动脚本
  4. nano /jffs/scripts/post-mount

  5. 最后一行添加
  6. sh /opt/69start.sh &
复制代码


69start.sh 文件内容为以下 在/opt 下建立
  1. #!/bin/sh
  2. swapon /opt/.swap
复制代码

安装sftp服务
  1. opkg install openssh-sftp-server
复制代码



临时交流 ⇨点我留言
【附件·直下】非必要·勿注册

网格·联系我们 ( 京ICP备16001788号|京公网安备 11010502049360号 ) | 网站地图 | 2012- WGPro.CoM |

GMT+8, 2024-3-29 15:26

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表