Online installation of Nginx environment method in Linux (Centos/ubuntu/debian)

Source: Internet
Author: User
Tags centos

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.