你好,我是gjs

计算机应用技术专业 · 25计算机A1班

👋 自我介绍

本网站基于 Rocky Linux9 + Nginx + HTTPS 部署,是《服务器运维》课程作业。

学习方向:Linux服务器加固、网站部署、网络与安全。

📖 课程学习笔记

第01讲 服务器安全加固

#查看ssh登录失败日志
journalctl -u sshd | grep -i "failed" | tail -30
#测试sshd配置
sudo sshd -t
#firewalld永久放行ssh
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload

第02讲 网站上线 Nginx与域名解析

#安装启动nginx
sudo dnf install -y nginx
sudo systemctl enable --now nginx
#配置语法检查
sudo nginx -t
#放行http(80端口)
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
#查看访问日志
sudo tail -f /var/log/nginx/mysite_access.log

第03讲 HTTPS证书与自动续期

#安装certbot
sudo dnf install -y certbot
#演练申请证书
sudo certbot certonly --webroot -w /var/www/mysite -d shturl. -d www.shturl. --dry-run
#演练续期
sudo certbot renew --dry-run
#查看证书列表
sudo certbot certificates