centos7 nginx安装及自启动

本文章为转载:https://blog.csdn.net/lisheninasiainfo/article/details/53576038

 

下载 nginx的rpm包

wget  http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm


建立nginx的yum仓库

[root@localhost conf.d]# rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm

下载并安装nginx

yum install nginx

然后会尝试个站点的镜像,163镜像下载安装

启动nginx服务

systemctl start nginx

查看以下nginx的进程:

[root@localhost conf.d]# ps aux |grep nginx
root     14631  0.0  0.0  48552  1032 ?        Ss   22:18   0:00 nginx: master process nginx -c /etc/nginx/nginx.conf
nginx    14633  0.0  0.0  51100  2556 ?        S    22:18   0:00 nginx: worker process
root     15040  0.0  0.0 112704   956 pts/2    S+   22:24   0:00 grep --color=auto nginx

查看nginx版本信息和相关的配置参数

# nginx -V   

系统的nginx的service文件在  /lib/systemd/system

用户的nginx的service文件在 /usr/lib/systemd/system

systemctl enable nginx.service

这样就可以配置开机自起了

转载于:https://www.cnblogs.com/kimkat/p/9197399.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值