Linux centos7.7 中安装nginx

国际惯例,先上图lamp or lnmp不做过多解释。

环境检查Linux版本,是否安装Apache,是否已经安装nginx

[root@localhost notes]# cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)
[root@localhost notes]# rpm -q httpd
package httpd is not installed
[root@localhost notes]# rpm -q nginx
package nginx is not installed

###添加Nginx到YUM源,除了太长,没毛病。

[root@localhost notes]# sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
Retrieving http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
warning: /var/tmp/rpm-tmp.PxwEzV: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:nginx-release-centos-7-0.el7.ngx ################################# [100%]

安装nginx虽然已经是root 了,但还是低调的用上了sudo,过程全自动不过多解释。 

这里就不wget下载,tar解压,./configure配置,make编译,make install安装了,有了yum干嘛不享受呢。

人生苦短,我用yum!!!

[root@localhost notes]# sudo yum install -y nginx 
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirror.bit.edu.cn
 * updates: mirror.bit.edu.cn
nginx                                                                                                                         
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值