/*************************************************************************
* CentOS 6.6 nginx install
* 说明:
* 在VPS上安装nginx,以供有些时候无聊使用。
*
* 2016-11-26 深圳 南山平山村 曾剑锋
************************************************************************/
一、参考文档:
Centos6 下的 nginx 安装
http://blog.163.com/liwei1987821@126/blog/static/17266492820121119111120164/
二、安装nginx:
. 错误:
[root@localhost ~]# yum install nginx
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.usc.edu
* extras: mirror.scalabledns.com
* updates: mirror.hostduplex.com
No package nginx available.
Error: Nothing to do
. 解决办法:
wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
rpm -ivh nginx-release-centos--.el6.ngx.noarch.rpm
. 安装:
[root@localhost ~]# yum install nginx
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.usc.edu
* extras: mirror.scalabledns.com
* updates: mirror.hostduplex.com
nginx | 2.9 kB :
nginx/primary_db | kB :
Resolving Dependencies
--> Running transaction check
---> Package nginx.i386 :1.10.-.el6.ngx will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
nginx i386 1.10.-.el6.ngx nginx k
Transaction Summary
================================================================================
Install Package(s)
Total download size: k
Installed size: 2.0 M
Is this ok [y/N]: y
Downloading Packages:
nginx-1.10.-.el6.ngx.i386.rpm | kB :
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : nginx-1.10.-.el6.ngx.i386 /
----------------------------------------------------------------------
Thanks for using nginx!
Please find the official documentation for nginx here:
* http://nginx.org/en/docs/
Commercial subscriptions for nginx are available on:
* http://nginx.com/products/
----------------------------------------------------------------------
Verifying : nginx-1.10.-.el6.ngx.i386 /
Installed:
nginx.i386 :1.10.-.el6.ngx
Complete!
[root@localhost ~]#