diff --git a/anolis-courses/nginx/deploy/finish.md b/anolis-courses/nginx/deploy/finish.md new file mode 100755 index 0000000000000000000000000000000000000000..7f1353d0fb1a25347060cb350e8dc344fc43e528 --- /dev/null +++ b/anolis-courses/nginx/deploy/finish.md @@ -0,0 +1 @@ +恭喜你已经完成nginx部署,自定义HelloWorld页面创建以及环境还原体验! \ No newline at end of file diff --git a/anolis-courses/nginx/deploy/index.yaml b/anolis-courses/nginx/deploy/index.yaml new file mode 100755 index 0000000000000000000000000000000000000000..59b03b34f13d8d432ad86a8b61cb7cee0c8b3633 --- /dev/null +++ b/anolis-courses/nginx/deploy/index.yaml @@ -0,0 +1,22 @@ +name: deploy +desc: 部署nginx,并自定义HelloWorld +image: Anolis OS 8.4 ANCK 64位 +live_time: 30min +machine: x86_64-2c4g +max_clients: 1 +details: + steps: + start: start.md + - name: 安装部署nginx + content: step2.md + - name: 访问nginx欢迎页面 + content: step3.md + - name: 添加自定义HelloWorld页面 + content: step4.md + - name: 重启nginx服务 + content: step5.md + - name: 访问HelloWorld页面 + content: step6.md + - name: 环境还原 + content: step7.md + finish: finish.md diff --git a/anolis-courses/nginx/deploy/start.md b/anolis-courses/nginx/deploy/start.md new file mode 100755 index 0000000000000000000000000000000000000000..2133b3d25a15cfbde8d0347a4f0ffa3865a9364c --- /dev/null +++ b/anolis-courses/nginx/deploy/start.md @@ -0,0 +1 @@ +本场景提供龙蜥操作系统,提供nginx服务部署以及自定义HelloWorld页面体验。 \ No newline at end of file diff --git a/anolis-courses/nginx/deploy/step2.md b/anolis-courses/nginx/deploy/step2.md new file mode 100755 index 0000000000000000000000000000000000000000..9cc25c571102bf983043bb7b350efdf55a127d80 --- /dev/null +++ b/anolis-courses/nginx/deploy/step2.md @@ -0,0 +1,10 @@ +```bash +dnf install nginx -y +systemctl status nginx +systemctl start nginx +# 防火墙配置 +systemctl status firewalld +firewall-cmd --list-ports +firewall-cmd --zone=public --add-port=80/tcp --permanent +firewall-cmd --reload +``` \ No newline at end of file diff --git a/anolis-courses/nginx/deploy/step3.md b/anolis-courses/nginx/deploy/step3.md new file mode 100755 index 0000000000000000000000000000000000000000..3d0dae14e86b572c68aac8c9798c52c3dadfbf31 --- /dev/null +++ b/anolis-courses/nginx/deploy/step3.md @@ -0,0 +1,6 @@ +```bash +curl 127.0.0.1 + +# 网页访问 +http://xx.xx.xx.xx +``` \ No newline at end of file diff --git a/anolis-courses/nginx/deploy/step4.md b/anolis-courses/nginx/deploy/step4.md new file mode 100755 index 0000000000000000000000000000000000000000..52c2576b228b4f549e7634e7c47921d23e9eff0c --- /dev/null +++ b/anolis-courses/nginx/deploy/step4.md @@ -0,0 +1,24 @@ +```bash +cd /usr/share/nginx/html +mkdir helloworld +cd helloworld +# 创建helloworld.html,内容如下: + + + + + +

Hello World

+ + + +# 编辑/etc/nginx/nginx.conf文件,添加hello.html文件的location +# 在原有的内容: +error_page 404 /404.html; + location = /404.html { + } +# 上方添加如下内容: +location /hello.html { + root /usr/share/nginx/html/helloworld; + } +``` \ No newline at end of file diff --git a/anolis-courses/nginx/deploy/step5.md b/anolis-courses/nginx/deploy/step5.md new file mode 100755 index 0000000000000000000000000000000000000000..3d19d4b2989a062714991b3493c8c6ee3a7a9d21 --- /dev/null +++ b/anolis-courses/nginx/deploy/step5.md @@ -0,0 +1,3 @@ +```bash +systemctl restart nginx +``` \ No newline at end of file diff --git a/anolis-courses/nginx/deploy/step6.md b/anolis-courses/nginx/deploy/step6.md new file mode 100755 index 0000000000000000000000000000000000000000..456f1f9a6fef7df34f1d61acda9ff3779846f31a --- /dev/null +++ b/anolis-courses/nginx/deploy/step6.md @@ -0,0 +1,6 @@ +```bash +curl http://127.0.0.1:80/hello.html + +# 页面访问 +http://xx.xx.xx.xx:80/hello.html +``` \ No newline at end of file diff --git a/anolis-courses/nginx/deploy/step7.md b/anolis-courses/nginx/deploy/step7.md new file mode 100755 index 0000000000000000000000000000000000000000..5a4a1a53736d027b779f75dacde84c8e3ae15ef1 --- /dev/null +++ b/anolis-courses/nginx/deploy/step7.md @@ -0,0 +1,12 @@ +```bash +# 删除自定义界面 +rm -rf /usr/share/nginx/html/helloworld +# 停止nginx服务 +systemctl stop nginx +systemctl status nginx +# 卸载nginx +dnf -y remove nginx +# 清除防火墙规则 +firewall-cmd --zone=public --remove-port=80/tcp --permanent +firewall-cmd --reload +``` \ No newline at end of file diff --git a/anolis-courses/nginx/index.yaml b/anolis-courses/nginx/index.yaml new file mode 100755 index 0000000000000000000000000000000000000000..4a5c23a8be11826b27689e3393efb0f7a5c539a7 --- /dev/null +++ b/anolis-courses/nginx/index.yaml @@ -0,0 +1,10 @@ +name: nginx +desc: 体验nginx服务 +type: course +total_time: 30min +level: beginner +chapters: + - name: deploy + desc: 部署nginx,并自定义HelloWorld + content: + live_time: 30min \ No newline at end of file