在 AWS 上自动启动 apache 和 mySQL Server

Joh*_*ner -4 mysql start amazon-web-services apache-2.2

我已经在我的 AWS EC2 实例上设置了 apache、mysql 和 php,但是如何在 EC2 启动时启动这些服务?我找到了chkconfig -a mysql命令,但这只是给出了一个错误,如option -a not found.

use*_*517 8

我为你阅读了chkconfig 手册页,它说

chkconfig [--level <levels>] [--type <type>]<name> <on|off|reset|resetpriorities>
Run Code Online (Sandbox Code Playgroud)

所以

chkconfig --level 3 mysqld on
Run Code Online (Sandbox Code Playgroud)

将在运行级别 3 启动 mysql 守护进程。同样

chkconfig --level 3 httpd on
Run Code Online (Sandbox Code Playgroud)

将在运行级别 3 中启动 Apache。