1. First go to the nginx official website to download the nginx installation package
After downloading, you will see a file similar to the following
Create the nginx-src directory And go to the nginx-src directory and run the following command:
mkdir nginx-src && cd nginx-src
Of course, you can also run the following command under Linux to download the nginx installation package
wget http://nginx.org/download/nginx-1.5.9.tar.gz
2. Unzip the nginx-1.5.9.tar.gz file
tar -zxvf nginx-1.5.9.tar.gz
rm -f nginx-1.5.9.tar.gz
4. Configure installation and run command
cd nginx-1.5.9/ ./configure --prefix=/usr/local/nginx
prompts missing package:
./configure: error: the http rewrite module requires the pcre library.You can either disable the module by using --without-http_rewrite_moduleoption, or install the pcre library into the system, or build the pcre librarystatically from the source with nginx by using --with-pcre=Install pcre-devel to solve the problem (needs to be running under the network and Is the super administrator identity)
yum -y install pcre-devel yum -y install openssl openssl-devel
Reconfigure now./configure --prefix=/usr/local/nginxIf the reconfiguration fails, you need to install gcc
yum –y install gcc
The above is the detailed content of Analysis of Nginx installation examples in Linux centos7 environment. For more information, please follow other related articles on the PHP Chinese website!