几个需要用到的网站
Raspbain官方系统镜像下载:https://www.raspberrypi.org/software/operating-systems/
阿里云开源镜像站:https://developer.aliyun.com/mirror/
Java官方下载地址:https://www.oracle.com/cn/java/technologies/javase/javase-jdk8-downloads.html
balenaEtcher官方下载地址:https://www.balena.io/etcher/
MobaXterm官方下载地址:https://mobaxterm.mobatek.net/download.html
安装系统
需要准备一张32G的SD卡
系统安装工具为:balenaEtcher
安装RNDIS驱动
配置config.txt、cmdline.txt、ssh、,通过OTG接口本地ssh连接
config.txt
//最后一行
dtoverlay=dwc2
cmdline.txt
//rootawait 后面空一格
modules-load=dwc2,g_ether
wpa_supplicant.conf
country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="******"
psk="******"
key_mgmt=WPA-PSK
priority=1
}
推荐使用MobaXterm这个远程连接工具
ssh登录地址:raspberrypi.local
默认用户名:pi
默认密码:raspberry
环境搭建
修改登录密码
sudo passwd pi
修改apt源
/etc/apt/sources.list
deb https://mirrors.aliyun.com/raspbian/raspbian/ buster main non-free contrib
deb-src https://mirrors.aliyun.com/raspbian/raspbian/ buster main non-free contrib
安装基本软件
//更新软件源列表
sudo apt-get update
//升级软件包
sudo apt-get upgrade
//安装neovim、git、neofetch
sudo apt-get install neovim git neofetch
python
//安装pip
sudo apt-get install python3-pip
//修改pip阿里源
nvim ~/.pip/pip.conf
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
java
//安装java8
sudo apt-get install openjdk-8-jdk
mariadb
//安装mariadb服务器
sudo apt-get install mariadb-server
//修改mariadb服务器root密码
sudo mysqladmin -u root password
//MariaDb和MySQL5.x远程登录账号
GRANT ALL PRIVILEGES ON *.* TO 'hui'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
//MySQL8.0远程登录账号
CREATE user 'hui'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'hui'@'%' WITH GRANT OPTION;
//刷新权限
FLUSH PRIVILEGES;
tomcat
//安装tomcat
sudo apt-get install tomcat9
//war包部署位置
/var/lib/tomcat9/webapps
//server.xml位置
/etc/tomcat9/server.xml
nginx
//安装nginx
sudo apt-get install nginx
//网站部署位置
/var/www/html
//服务器配置文件
/etc/nginx/sites-enabled/default
php
sudo apt-get install php7.3 php7.3-fpm php7.3-mysql php7.3-xml php7.3-gd php7.3-curl