侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

centos7直接yum安装nginx

2023-11-12 星期日 / 0 评论 / 0 点赞 / 52 阅读 / 2014 字

导入源 导入rpm包 rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.

导入源

导入rpm包

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

或者

创建源

安装准备依赖lib库

yum install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel

创建/etc/yum.repos.d/nginx.repo
添加以下,以centos7为例

[nginx]name=nginx repobaseurl=http://nginx.org/packages/mainline/rhel/7/$basearch/gpgcheck=0enabled=1

导入key

rpm –import http://nginx.org/keys/nginx_signing.key

 

查看yum中的nginx信息

[root@localhost ~]# yum info nginxLoaded plugins: fastestmirror, langpacksnginx                                                                                                                                                                                                                 | 2.9 kB  00:00:00nginx/x86_64/primary_db                                                                                                                                                                                               |  19 kB  00:00:00Loading mirror speeds from cached hostfile * base: centos.nethub.com.hk * extras: centos.nethub.com.hk * updates: centos.nethub.com.hkAvailable PackagesName        : nginxArch        : x86_64Version     : 1.10.2Release     : 1.el6.ngxSize        : 825 kRepo        : nginx/x86_64Summary     : High performance web serverURL         : http://nginx.org/Licence     : 2-clause BSD-like licenseDescription : nginx [engine x] is an HTTP and reverse proxy server, as well as            : a mail proxy server.

安装

[root@localhost ~]# yum install nginx

启动

[root@localhost ~]# service nginx start

 

 

 

 

 

 

 

广告 广告

评论区