Preface
Nginx is similar to the role of Apache, are to provide WEB services, but Nginx, compared to Apache, in the performance of a better embodiment, and Apache stability will be better than nginx, so to use which one, like good. Here is to share the next Nginx installation and configuration method. If you think the following record is a bit messy, you can directly see the summary is also possible later in this article, more time-saving, more worry. I am here. Small Episode
If you execute the command directly,
# yum Install Nginx
You'll get a hint like this
Loaded Plugins:fastestmirror
Loading mirror speeds from cached hostfile
* base:mirrors.yun-idc.com
* extras:mirrors.tuna.tsinghua.edu.cn
* rpmforge:mirrors.neusoft.edu.cn
* updates:mirrors.tuna.tsinghua.edu.cn
No package Nginx available.
Error:nothing to do
No package nginx available. (Can not find Nginx installation packages), so we have to configure, let the system automatically to help you to download, execute the following code
# Vim/etc/yum.repos.d/nginx.repo
If you do not have this file (usually not), the system will automatically create a new for you, press the keyboard I into the editing mode, copy the following paste into the file, press ESC to exit the edit mode, press: Wq save exit.
[Nginx]
Name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled= 1
Also if your system is CentOS 7.2 or above, then you can directly execute the following command line.
# yum Install Nginx
nginx Installation Configuration
Now directly enter the following command line to install, you will forcefully, all the way unimpeded.
# yum Install Nginx
Installation Record
Here is the full record of nginx installation process
[root@niaoyun53098 ~]# yum install nginx Loaded plugins:fastestmirror Nginx | 2.9 KB 00:00 nginx/7/x86_64/primary_db | KB 00:01 Loading Mirror speeds from cached Hostfile * base:mirrors.yun-idc.com * extras:mi
rrors.tuna.tsinghua.edu.cn * rpmforge:mirrors.neusoft.edu.cn * updates:mirrors.tuna.tsinghua.edu.cn Resolving Dependencies-Running transaction Check---> Package nginx.x86_64 1:1.10.1-1.e
L7.ngx'll be installed--finished Dependency Resolution Dependencies resolved ================================================================================ Package Arch Version R Epository Size ================================================================================ Installi
Ng:nginx x86_64 1:1.10.1-1.el7.ngx nginx 640 k Transaction Summary ================================================================================ Install 1 Package
Total Download size:640 k