diff --git "a/24 \347\224\260\351\233\252\347\220\274/20240624 \346\234\215\345\212\241\347\256\241\347\220\206\347\254\224\350\256\260.md" "b/24 \347\224\260\351\233\252\347\220\274/20240624 \346\234\215\345\212\241\347\256\241\347\220\206\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..5951cf4fa739c94fa6620c8be873d8c612733daa --- /dev/null +++ "b/24 \347\224\260\351\233\252\347\220\274/20240624 \346\234\215\345\212\241\347\256\241\347\220\206\347\254\224\350\256\260.md" @@ -0,0 +1,89 @@ +# 笔记 + +## 服务管理 + +system v 用 + +``` +/etc/init.d/nginx start +``` + +systemd用 + +``` +systemctl start nginx +``` + +服务管理常用的命令 + +``` +start 启用 +stop 停止 +restart 重启 +reload 重加载配置 +status 状态 +enable 开机自启用 +disable 禁用 +``` + +查看所有运行的服务 + +``` +service --status-all (简约,直观) +systemctl list-unit-files (详细版) +``` + +systemctl 指令 服务 + +## 作业 + +给自己的服务器安装一个apache服务与linux共存步骤 + +安装Apache + +1.安装Apache更新包管理器索引: + +``` +root@hecs-196642:~# apt-get update +``` + +2.安装Apache2 + +``` +root@hecs-196642:~# apt-get install apache2 +``` + +3.修改变量 + +``` +root@hecs-196642:~# cd /etc/apache2 +root@hecs-196642:/etc/apache2# ls +apache2.conf conf-available conf-enabled envvars magic mods-available mods-enabled ports.conf sites-available sites-enabled +root@hecs-196642:/etc/apache2# vim ports.conf + 在vim写入 + +Listen 8080 + + + Listen 440 + + + + Listen 440 + + +``` + +4.修改安全组 + +``` +在华为云中修改安全组 +``` + +5.重启apache + +``` +root@hecs-196642:/etc/apache2# systemctl restart apache2 +``` + +6.访问 \ No newline at end of file