CentOS 5 上安装 nginx
#yum install nginx
补充:
如果遇到以下错误提示:
[root@localhost ~]# yum -y install nginx Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centos.ustc.edu.cn * base: centos.ustc.edu.cn * extras: centos.ustc.edu.cn * updates: data.nicehosting.co.kr Setting up Install Process No package nginx available. Nothing to do
原因是:
对CentOS系统而言,Nginx不在标准库里,不过可以使用EPEL库,EPEL参考资料(http://www.cyberciti.biz/faq/rhel-fedora-centos-linux-enable-epel-repo/)。  使用EPEL库安装Nginx,命令如下: # rpm -Uvh   http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
检查一下 yum list:
#yum repolist
[root@localhost ~]# yum repolist Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centos.ustc.edu.cn * base: centos.ustc.edu.cn * extras: centos.ustc.edu.cn * updates: data.nicehosting.co.kr repo id repo name status addons CentOS-5 - Addons enabled: 0 base CentOS-5 - Base enabled: 3,434 extras CentOS-5 - Extras enabled: 303 updates CentOS-5 - Updates enabled: 919 repolist: 4,656
如果没有 EPEL, 运行:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
版本号需要调整, 如果找不到。
[root@localhost ~]# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm Retrieving http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm error: skipping http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm - transfer failed - Unknown or unexpected error [root@localhost ~]# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm Retrieving http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm warning: /var/tmp/rpm-xfer.2DN7ju: Header V3 DSA signature: NOKEY, key ID 217521f6 Preparing... ########################################### [100%] 1:epel-release ########################################### [100%]
再检查一下 yum list,
[root@localhost ~]# yum repolist Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: centos.ustc.edu.cn * base: centos.ustc.edu.cn * epel: ftp.sjtu.edu.cn * extras: centos.ustc.edu.cn * updates: data.nicehosting.co.kr epel | 3.7 kB 00:00 epel/primary_db | 3.3 MB 00:15 repo id repo name status addons CentOS-5 - Addons enabled: 0 base CentOS-5 - Base enabled: 3,434 epel Extra Packages for Enterprise Linux 5 - x86_64 enabled: 5,832 extras CentOS-5 - Extras enabled: 303 updates CentOS-5 - Updates enabled: 919 repolist: 10,488
如果 EPEL 更新成功, 则运行:
#yum install nginx
相关推荐
  87901735    2020-06-02  
   shenzhenzsw    2020-06-03  
   spb    2020-06-02  
   89284553    2020-06-02  
   oZaoHua    2020-04-19  
   shirley0lhz    2020-02-14  
   80327065    2020-02-03  
   lilygg    2019-12-26  
   秋风瑟瑟    2019-12-21  
   suject    2019-12-07  
   85407718    2019-12-04  
   83500399    2019-12-02  
   88510498    2019-11-29  
   独行者0    2019-11-30  
   wennuanwarm    2019-12-02  
   85530494    2013-08-11