刘明野

树莓派4B ubuntu19.10 安装宝塔 lnmp 环境

开始安装

安装宝塔面板:

cd ~/
wget -O install.sh http://download.bt.cn/install/install-ubuntu.sh && sudo bash install.sh

安装LuaJIT(OpenResty版本):

cd ~/
wget -c -O luajit2-2.1-20190530.tar.gz https://github.com/openresty/luajit2/archive/v2.1-20190530.tar.gz -T 5
tar xvf luajit2-2.1-20190530.tar.gz
cd luajit2-2.1-20190530
sudo make
sudo make install

安装Lua Cjson(OpenResty版本):

cd ~/
wget -O lua-cjson-2.1.0.7.tar.gz https://github.com/openresty/lua-cjson/archive/2.1.0.7.tar.gz -T 5
tar xvf lua-cjson-2.1.0.7.tar.gz
cd lua-cjson-2.1.0.7
sudo make LUA_INCLUDE_DIR=/usr/local/include/luajit-2.1
sudo make install

准备安装Nginx:
  首先登录进入宝塔面板,在面板中安装Nginx,等待30秒左右,再关闭安装任务,此时在/www/server/panel/install目录中出现nginx.sh脚本。
修改脚本:

sudo vi /www/server/panel/install/nginx.sh

  第165行,改为LuaModVer="0.10.15"
  第166行,改为wget -c -O lua-nginx-module-${LuaModVer}.zip https://github.com/openresty/lua-nginx-module/archive/v0.10.15.zip -T 5
  第482行,注释掉Install_LuaJITInstall_cjson,并另起两行分别加上export LUAJIT_LIB=/usr/local/libexport LUAJIT_INC=/usr/local/include/luajit-2.1/
安装Nginx(Tengine):

cd /www/server/panel/install
sudo sh nginx.sh install

  脚本执行完成没有失败提示即为成功,可在面板上找到已安装的Nginx Tengine。若出现错误警告,查看文末的问题解决。
安装MySQL 5.5:
  树莓派的物理内存只有1G,被GPU占用掉一部分后只剩大概860MB,且编译MySQL需要使用大量内存,所以先检查虚拟内存是否足够,可以先临时设置1G大小,设置完成就可以编译了。编译时间较长,大约30分钟。

cd /www/server/panel/install
sudo sh mysql.sh install 5.5

  脚本执行完成没有失败提示即为成功,可在面板上找到已安装的MySQL 5.5。错误警告暂未发现。
安装PHP 7.3:
  PHP可直接安装,仅安装测试了7.0+版本的,7.0以下的自行测试,感觉对ARM平台的兼容性还不错。

cd /www/server/panel/install
sudo sh php.sh install 7.3

问题与解决

错误警告1:

nginx: [error] lua_load_resty_core failed to load the module from https://github.com/openresty/******; ensure you are using an OpenResty release from https://openresty.org/en/download.html (rc: 2, reason: module '******' not found:……

产生原因:
  缺少lua-resty-core和lua-resty-lrucache。
解决方法:
  安装lua-resty-core和lua-resty-lrucache。由于官方安装包中的Makefile里写的安装路径与上面安装的Lua路径不同,所以我稍作修改后打包并上传了。

cd ~/
wget -c -O lua-resty-core-0.1.17.tar.gz https://gitee.com/liumingye/lib/raw/master/lua-resty-core-0.1.17.tar.gz -T 5
tar xvf lua-resty-core-0.1.17.tar.gz
cd lua-resty-core-0.1.17
sudo make install
cd ..
wget -c -O lua-resty-lrucache-0.09.tar.gz https://gitee.com/liumingye/lib/raw/master/lua-resty-lrucache-0.09.tar.gz -T 5
tar xvf lua-resty-lrucache-0.09.tar.gz
cd lua-resty-lrucache-0.09
sudo make install

  最后重启Nginx即可。

sudo /etc/init.d/nginx restart

转载于:https://www.flasky.cn/raspberry-pi/install-bt-panel.html (有删改)

本文为作者刘明野发布,未经允许禁止转载!
3141
0
0
发表留言

友情链接