Solve error: the HTTP rewrite module requires the PCRE library.
Centos 64-bit
Step 1: Download the corresponding version from http://nginx.org/download/( or wget http://nginx.org/download/nginx-1.5.9.tar.gzdirectly on linux)
Step 2: unzip tar-zxvf nginx-1.5.9.tar.gz
Step 3: Set the configuration information./configure -- prefix =/usr/local/nginx, or do not execute this step.
Step 4:
Make compilation (The make process is to convert source code files written in various languages into executable files and various library files)
Make install (make install copies the compiled executable files and library files to appropriate places)
When configuring information, that is, in step 3, an error occurs:
Error:./configure: error: the HTTP rewrite module requires the PCRE library.
Install pcre-devel to solve the problem
Yum-y install pcre-devel
It is also possible that:
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 = <path> options.
Solution:
Yum-y install openssl-devel
After installation, start and disable nginx in linux:
Start Operation
/Usr/nginx/sbin/nginx (/usr/nginx/sbin/nginx-t to check whether the configuration information is correct)
Stop operation
The stop operation is performed by sending a signal to the nginx process (for more information about the signal, see the linux document ).
Step 1: query the nginx master process number
Ps-ef | grepnginx
Find the master process in the process list. Its number is the master process number.
Step 2: send signals
Stop Nginx with ease:
Kill-QUIT master process number
Stop Nginx quickly:
Kill-TERM master process number
Force stop Nginx:
Pkill-9nginx
In addition, if the pid file storage path is configured in nginx. conf, the file stores the Nginx main process number. If no pid file is specified, the file is placed in the nginx logs directory. With the pid file, we do not need to query the main process Number of Nginx first, but directly send a signal to Nginx. The command is as follows:
Kill-signal type '/usr/nginx/logs/nginx. pid'
Smooth restart
If you change the configuration, restart Nginx. Do you need to disable Nginx before enabling Nginx? No. You can send a signal to Nginx to restart Nginx smoothly.
Smooth restart command:
Kill-HUP enters the title or process number file path
Or use
/Usr/nginx/sbin/nginx-sreload
Note: After modifying the configuration file, it is best to check whether the modified configuration file is correct to avoid Nginx errors after restart, which may affect the stable running of the server. The command to determine whether the Nginx configuration is correct is as follows:
Nginx-t-c/usr/nginx/conf/nginx. conf
Or
/Usr/nginx/sbin/nginx-t for example: