[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