Home >Backend Development >PHP Tutorial >centos7 install nginx
Install nginx
Download the installation package
http://nginx.org/en/download.html Download the latest nginx-1.9.6.tar.gz
Put it into centos 7 /usr/local
Unzip tar -zxvf nginx-1.9 .6.tar.gz
Create the nginx directory mkdir /usr/local/nginx
Enter the decompression directory cd /usr/local/nginx-1.9.6
Install nginx
Next, install, use the --prefix parameter to specify the directory where nginx is installed , make, make install installation
./configure $The default installation is in /usr/local/nginx
If there is an error message: ./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library. You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with- openssl=
Solution:
yum -y install pcre-devel openssl openssl-devel
./configure --prefix=/usr/local/nginx
Continue to install
make
make install
The startup command of nginx is:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
Restart
/usr/local/nginx/sbin/ nginx -s reload
The above introduces the installation of nginx on centos7, including the require content. I hope it will be helpful to friends who are interested in PHP tutorials.