Install Nginx 1.7.4 on CentOS7.0
I. Installation preparation
First, some modules of nginx depend on some lib libraries. Therefore, you must install these lib libraries before installing nginx, these dependent libraries mainly include g ++, gcc, openssl-devel, pcre-devel, and zlib-devel. Therefore, run the following command to install
[Html] view plaincopy
- $ Yuminstallgcc-c ++
- $ Yuminstallpcrepcre-devel
- $ Yuminstallzlibzlib-devel
- $ Yuminstallopensslopenssl -- devel
Ii. Install Nginx
Before installing nginx, check whether nginx is installed.
[Html] view plaincopy
- $ Find-nameng.pdf
If the system has installed nginx, uninstall it first.
[Html] view plaincopy
- $ Yumremoveng.pdf
First, go to the/usr/local directory.
[Html] view plaincopy
- $ Cd/usr/local
Download the latest nginx version from the official website
[Html] view plaincopy
- $ Wgethttp: // nginx.org/download/nginx-1.7.4.tar.gz
Decompress the nginx package
[Html] view plaincopy
- $Tar-zxvfnginx-1.7.4.tar.gz
A nginx-1.7.4 directory is generated and you enter the nginx-1.7.4 directory
[Html] view plaincopy
- $ Cdnginx-1.7.4
Next, use the -- prefix parameter to specify the nginx installation directory, and install make and makeinstall.
[Html] view plaincopy
- $./Configure $ installed in/usr/local/nginx by default
- $ Make
- $ Makeinstall
If no error is reported, check the nginx installation directory.
[Html] view plaincopy
- $ Whereisnginx
After installation, you can start or stop the directory (/usr/local/nginx) after installation.
At this point, the installation of nginx using CentOS has been completed. In fact, it is quite simple.