初尝树莓派zero wh

19年8月10日购得树莓派 zero wh 一枚,展转4天于8月14日到手。php

初拆包装盒,讶其如此之小,可他的确是一台微型电脑,基本功能都有。html

火烧眉毛的查询资料怎么把他跑起来。mysql

1,装系统linux

官方有教程确定是用官方的教程,有好些种版本,一开始下的带桌面版(不懂英文致使),后来靠的谷歌浏览器的翻译才知道应该下 Raspbian Buster Lite,顺便说下,我不须要桌面,只须要ssh链接,并且不用数据线(供电线仍是要的),只用远程(wifi)链接。android

官网还有烧录教程:https://www.raspberrypi.org/documentation/installation/installing-images/README.mdnginx

我根据这位同窗的教程 https://www.jianshu.com/p/95701c72bbc9 下载了 SDFormatter(格式化工具)和 Win32DiskImager(系统烧录工具),可是只用了格式化工具,烧录软件用的官网推荐的,不知道不格式化有没有问题,下次尝试下。git

2,配置 wifi 和 sshgithub

参考教程:http://shumeipai.nxez.com/2017/09/13/raspberry-pi-network-configuration-before-boot.htmlredis

烧录完系统后,读卡器拔出来从新插上,否则找不到 U 盘,从新插上 U 盘会提示是否格式化 U 盘,选 否 就是了。sql

还有个须要注意的地方,烧录完系统后内存卡不能立刻插到树莓派使用,否则配置的 ssh 和 wifi 会被删除。

通常烧录完系统后盘符会变成 boot,配置 ssh 只须要在 boot 根目录新建一个空白的文件名为 ssh 的文件便可。配置wifi参考上面的教程。

启用 root 设置密码并设置容许 ssh 登陆http://www.javashuo.com/article/p-ahbxhbbv-dx.html

ps:ssh ip 处可填"respberrypi.local"

 

!!!若是安装过程当中遇到问题,试试将 apt 换成 apt-get

原本想装个宝塔面板的,装是装上了(https://www.bt.cn/bbs/thread-19376-1-1.html 选“Debian安装命令”),可是装 lnmp 时 CPU 一直是 100%,有点不忍心怕烧坏了,遂放弃了集成面板/环境,仍是老老实实单个单个装吧。

安装 nginxhttps://nginx.org/en/linux_packages.html#Debian 

                配置文件:/etc/nginx/nginx.conf、/etc/nginx/conf.d/(添加自定义网站配置文件参考:/etc/nginx/sites-available/default)

                项目文件夹:/var/www/html

                命令:service nginx start/stop/restart/...

                卸载:apt --purge remove nginx*

安装 mysqlhttps://www.linuxidc.com/Linux/2019-07/159582.htm (https://linux265.com/news/3368.html

                没安装成功,让我用 mariadb 代替(sudo apt install mariadb-server (如何在Debian 9上安装MariaDB 只执行了前两步))。

                以上能够直接搜“debian 安装 nginx + php + mysql”

安装 phphttps://linux265.com/news/3366.html

                命令:service php7.2-fpm start/stop/restart/...

                卸载:sudo apt --purge remove php*

安装 redis

                方式一: https://www.cnblogs.com/zf29506564/p/5948579.html(未测试)

                方式二:sudo apt-get install redis-server(安装)、sudo apt-get remove/purge redis-server(卸载)、sudo apt-get autoremove <package>(卸载自动安装的包 慎用)

1. 卸载软件
apt-get remove redis

2. 清除配置
apt-get remove --purge redis

3. 删除残留文件
find / -name 'redis*'
--通常设置以下
rm -rf var/lib/redis/
rm -rf /var/log/redis
rm -rf /etc/redis/
rm -rf /usr/bin/redis-*

 

安装 php redis 扩展:
方式一:
sudo apt install php[version]-[extname]

例如,若是要安装MySQL和GD PHP扩展,则应运行如下命令:
sudo apt install php7.2-mysql php7.2-gd

方式二:
deepin/ubuntu php7.2安装php-redis扩展(https://blog.csdn.net/qq_31659985/article/details/97695438)

安装 ffmpeghttps://linux265.com/news/3609.html

                    ffmpeg 的使用:http://www.javashuo.com/article/p-qtcklrfs-ca.html

 

 

其余:

设置时区https://zh.wikihow.com/在Linux中更改时区

手机端查看树莓派IPAndroid获取实时链接热点的设备IP地址 (android term 中文名叫"终端模拟器")(还有网友推荐一款叫"Fing"的软件,没试用)

树莓派安装 Nginx + PHP7.0 + Pi Dashboard

在linux后台运行脚本的方法和命令

相关文章
相关标签/搜索