root@HomeLab:~# apt update && apt dist-upgrade Hit:1 https://mirrors.ustc.edu.cn/debian bullseye InRelease Hit:2 https://mirrors.ustc.edu.cn/debian bullseye-updates InRelease Hit:3 https://mirrors.ustc.edu.cn/debian-security bullseye-security InRelease Hit:4 https://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye InRelease Reading package lists... Done Building dependency tree... Done Reading state information... Done All packages are up to date. N: Ignoring file 'pve-enterprise.list_backup'in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. N: Ignoring file 'pve-enterprise.list_backup'in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
Automatically selected kernels: 5.15.74-1-pve 5.15.85-1-pve # 选中 5.15.85-1-pve 作为启动内核 root@HomeLab:~# proxmox-boot-tool kernel pin 5.15.85-1-pve Setting '5.15.85-1-pve' as grub default entry and running update-grub. Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.15.85-1-pve Found initrd image: /boot/initrd.img-5.15.85-1-pve Found linux image: /boot/vmlinuz-5.15.74-1-pve Found initrd image: /boot/initrd.img-5.15.74-1-pve Found memtest86+ image: /boot/memtest86+.bin Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry. Adding boot menu entry for UEFI Firmware Settings ... done # 查看内核 root@HomeLab:~# proxmox-boot-tool kernel list Manually selected kernels: None.
Pinned kernel: 5.15.85-1-pve # 卸载 pve-kernel-5.15.74-1-pve 内核 root@HomeLab:~# dpkg --purge pve-kernel-5.15.74-1-pve (Reading database ... 51104 files and directories currently installed.) Removing pve-kernel-5.15.74-1-pve (5.15.74-1) ... Examining /etc/kernel/postrm.d. run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve update-initramfs: Deleting /boot/initrd.img-5.15.74-1-pve run-parts: executing /etc/kernel/postrm.d/proxmox-auto-removal 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve run-parts: executing /etc/kernel/postrm.d/zz-proxmox-boot 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve Re-executing '/etc/kernel/postrm.d/zz-proxmox-boot'in new private mount namespace.. No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync. run-parts: executing /etc/kernel/postrm.d/zz-update-grub 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.15.85-1-pve Found initrd image: /boot/initrd.img-5.15.85-1-pve Found memtest86+ image: /boot/memtest86+.bin Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry. Adding boot menu entry for UEFI Firmware Settings ... done Purging configuration files for pve-kernel-5.15.74-1-pve (5.15.74-1) ... Examining /etc/kernel/postrm.d. run-parts: executing /etc/kernel/postrm.d/initramfs-tools 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve update-initramfs: Deleting /boot/initrd.img-5.15.74-1-pve run-parts: executing /etc/kernel/postrm.d/proxmox-auto-removal 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve run-parts: executing /etc/kernel/postrm.d/zz-proxmox-boot 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve Re-executing '/etc/kernel/postrm.d/zz-proxmox-boot'in new private mount namespace.. No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync. run-parts: executing /etc/kernel/postrm.d/zz-update-grub 5.15.74-1-pve /boot/vmlinuz-5.15.74-1-pve Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.15.85-1-pve Found initrd image: /boot/initrd.img-5.15.85-1-pve Found memtest86+ image: /boot/memtest86+.bin Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry. Adding boot menu entry for UEFI Firmware Settings ... done # 查看内核 root@HomeLab:~# proxmox-boot-tool kernel list Manually selected kernels: None.
# 查看 Nginx 服务状态 root@HomeLab ~$ systemctl status nginx ● nginx.service - Nginx-v1.22.1 Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2023-02-12 21:15:59 CST; 2s ago Process: 40027 ExecStartPre=/usr/local/nginx/v1.22.1/sbin/nginx -t -c /usr/local/nginx/v1.22.1/conf/nginx.conf (code=exited, status=0/SUCCESS) Process: 40029 ExecStart=/usr/local/nginx/v1.22.1/sbin/nginx -c /usr/local/nginx/v1.22.1/conf/nginx.conf (code=exited, status=0/SUCCESS) Main PID: 40030 (nginx) Tasks: 2 (limit: 18925) Memory: 1.8M CPU: 15ms CGroup: /system.slice/nginx.service ├─40030 nginx: master process /usr/local/nginx/v1.22.1/sbin/nginx -c /usr/local/nginx/v1.22.1/conf/nginx.conf └─40031 nginx: worker process
Feb 12 21:15:59 HomeLab systemd[1]: Starting Nginx-v1.22.1... Feb 12 21:15:59 HomeLab nginx[40027]: nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/nginx/v> Feb 12 21:15:59 HomeLab nginx[40027]: nginx: the configuration file /usr/local/nginx/v1.22.1/conf/nginx.conf syntax is ok Feb 12 21:15:59 HomeLab nginx[40027]: nginx: configuration file /usr/local/nginx/v1.22.1/conf/nginx.conf test is successful Feb 12 21:15:59 HomeLab nginx[40029]: nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/nginx/v> Feb 12 21:15:59 HomeLab systemd[1]: Started Nginx-v1.22.1.
完成 Nginx 配置后,不用端口号即可访问 PVE 管理网站
设置笔记本盒盖情况下 PVE 不休眠
1
root@pve:/root # vim /etc/systemd/logind.conf
1 2
# 添加下面内容 HandleLidSwitch=ignore
1 2
# 重启服务 root@pve:/root # service systemd-logind restart
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Wrg2022.MySQL'; CREATE USER 'gg'@'%' IDENTIFIED BY 'Wrg2022.MySQL'; GRANT ALL PRIVILEGES ON *.* TO 'gg'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; SELECT user, authentication_string, plugin, host FROM mysql.user;