nginx部分配置
=== 信不信由你 ===
默认会添加盘符,如果没有,请手动添加
选择文件时默认为img文件,下拉选择所有文件即可选择刚才解压的raw文件
此步可以省略。树莓派IP可以登录路由器上查找。
使用终端登录之后执行以下命令
fdisk /dev/mmcblk0 # 进入磁盘分区shell
# 查看目前分区情况,有三个mmcblk0p1~3
> p
# 删除最后一个分区,之后直接按enter即可
> d
# 查看是否删除成功
> p
# 新建分区
> n
# 选择主分区,因为刚才删除的就是主分区,分区号(Partition number)默认是3
> p
# .......... 注意 .......
# 下面看清楚:默认的起始sector如果是2048,则需要输入分区2(mmcblk0p2)结束(End)块区+1,然后一直ender下去即可;否则一直enter即可
#退出并保存分区
> w
# .......... 注意 .......
# 此时已经回到centos7的shell,执行以下命令,否则** 无法开机 **
touch /.rootfs-repartition
# 重启系统
systemctl reboot
# 开机之后执行,重新加载分区信息
resize2fs /dev/mmcblk0p3
# 查看分区信息
df -h
lsblk
mkdir -p /etc/yum.repos.d/bak
mv /etc/yum.repos.d/* /etc/yum.repos.d/bak
cat >/etc/yum.repos.d/development.repo <<EOF
[base]
name=CentOS-\$releasever - Base
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/\$releasever/os/\$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32
[updates]
name=CentOS-\$releasever - Updates
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/\$releasever/updates/\$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32
[extras]
name=CentOS-\$releasever - Extras
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/\$releasever/extras/\$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32
[centosplus]
name=CentOS-\$releasever - Plus
baseurl=http://mirrors.ustc.edu.cn/centos-altarch/\$releasever/centosplus/\$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-AltArch-Arm32
EOF
yum makecache
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
systemctl disable firewalld
systemctl stop firewalld