【发布时间】:2016-11-14 11:38:24
【问题描述】:
几周前,我在 AWS 上配置了一个 ec2 服务器,数据库在 RDS 上,我使用 nginx 作为 Web 服务器。当我从 AWS 控制台重启服务器时,我的 nginx 不会自动重启。我使用 service nginx start 命令做到了这一点。
有什么方法可以配置 nginx 服务器,所以当我重启我的 ec2 实例时它会重启
【问题讨论】:
标签: linux nginx amazon-ec2
几周前,我在 AWS 上配置了一个 ec2 服务器,数据库在 RDS 上,我使用 nginx 作为 Web 服务器。当我从 AWS 控制台重启服务器时,我的 nginx 不会自动重启。我使用 service nginx start 命令做到了这一点。
有什么方法可以配置 nginx 服务器,所以当我重启我的 ec2 实例时它会重启
【问题讨论】:
标签: linux nginx amazon-ec2
您可以使用以下命令将nginx 配置为在系统启动时自动启动。
#chkconfig nginx on
一旦你运行了上面的命令,nginx 总是会在系统启动时启动。
您可以使用以下命令检查服务是否配置为在系统启动时自动启动。
# chkconfig nginx --list
您可以使用以下命令禁用服务自动启动
# chkconfig nginx off
【讨论】: