First create a file
Vi/etc/yum.repos.d/nginx.repo
Copy the following text, save and exit
[Nginx]
Name=nginx Repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
Gpgcheck=0
Enabled=1
Run the following command to install
#yum Install Pcre Installation Dependency Pack
#yum Install Nginx
Some of the installation packages, such as the/ubuntu/debian system, have been sorted back.
Red Hat/centos Packages
Official Red Hat/centos packages to add Nginx Yum Repository, create a file Named/etc/yum.repos.d/nginx.repo and paste on E of the configurations below:
Centos:
[Nginx]
Name=nginx Repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
Gpgcheck=0
Enabled=1
RHEL:
[Nginx]
Name=nginx Repo
baseurl=http://nginx.org/packages/rhel/$releasever/$basearch/
Gpgcheck=0
Enabled=1
Due to differences between how CentOS, RHEL, and scientific Linux populate the $releasever variable, it are necessary to Ma nually replace $releasever with either ' 5 (for 5.x) or ' 6 ' (for 6.x), depending upon your OS version.
Official Debian/ubuntu Packages Append the appropriate stanza. The PGP page explains the signing of the nginx.org released packaging.
Ubuntu 10.04:
Deb Http://nginx.org/packages/ubuntu/lucid Nginx
DEB-SRC http://nginx.org/packages/ubuntu/lucid Nginx
Debian 6:
Deb Http://nginx.org/packages/debian/squeeze Nginx
DEB-SRC Http://nginx.org/packages/debian/squeeze Nginx
Ubuntu PPA
This are maintained by volunteers and isn't distributed by nginx.org. It has some additional compiled-in modules and may is more fitting for your environment.
You can get the latest stable version of Nginx from the Nginx PPA on launchpad:you'll need to have root privileges to P Erform the following commands.
For Ubuntu 10.04 and newer:
Sudo-s
Nginx=stable # Use Nginx=development for latest development version
Add-apt-repository ppa:nginx/$nginx
Apt-get Update
Apt-get Install nginxif You get a error about add-apt-repository not existing, you'll want to install Python-software-p Roperties. For other Debian/ubuntu based distributions, you can try the lucid variant of the PPA which are the most likely to work on Older package sets.
Sudo-s
Nginx=stable # Use Nginx=development for latest development version
echo "Deb http://ppa.launchpad.net/nginx/$nginx/ubuntu lucid main" >/etc/apt/sources.list.d/nginx-$ Nginx-lucid.list
Apt-key adv--keyserver keyserver.ubuntu.com--recv-keys c300ee8c
Apt-get Update
Apt-get Install Nginx
Official website Reference Http://wiki.nginx.org/Install