[Linux] PHP programmers play with Linux series-install nginx on Linux and Windows-linuxnginx

Source: Internet
Author: User

[Linux] PHP programmers play with Linux series-install nginx on Linux and Windows-linuxnginx

1. PHP programmers turn to the Linux series-how to install and use CentOS

2. PHP programmers play with Linux series-lnmp Environment Construction

3. PHP programmers play with the Linux series-build an FTP code Development Environment

4. PHP programmers turn to the Linux series-back up and restore MySQL

5. PHP programmers turn to the Linux series-automatic backup and SVN

How to install nginx in the simplest way? I found that the method on the official nginx website is the easiest after I searched for more than N methods. Here I will also handle the installation method on the official website.

 

Install nginx in CentOS

Of course, the package installation method is the easiest, and the nginx official website also provides the package installation method. first, go to the/etc/yum directory. repos. d/, and then create nginx. repo repository file. The file name can be obtained with the suffix. repo.

Modify the 6 in the middle based on your current CentOS version number.

[nginx]name=nginx repobaseurl=http://nginx.org/packages/centos/6/$basearch/gpgcheck=0

Then you can run the command yum install nginx to install nginx with one click, and it is the latest stable version installed.

 

Install nginx in Ubuntu

Nginx also provides the deb package, enter the/etc/apt directory, edit sources. list, and add the following two lines

Modify the trusty according to your ubuntu version.

12.04 Precise
14.04 Trusty
16.04 Xenial
16.10 Yakkety
deb http://nginx.org/packages/ubuntu/ trusty nginx                                                                             deb-src http://nginx.org/packages/ubuntu/ trusty nginx  

You can run the installation command and report an insecure warning.

sudo apt-get update sudo apt-get install nginx

 

Install nginx in Windows

Go to the official website to download the latest stable version.

Decompress the package, open the cmd window, run cd to the folder where nginx.exe is located, and run nginx

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.