|
Nginx is a high-performance HTTP server and reverse proxy, also a IMAP / POP3 / SMTP proxy server. Nginx by Igor Sysoev of Russia visited the second Rambler.ru site development, which has more than two and a half at the site running. Igor the source code to BSD license issued in the form
1, in order to ensure that the use of regular expressions in Nginx a more flexible configuration, prior to installation need to determine whether the system is installed PCRE (Perl Compatible Regular Expressions) package. You can download the latest PCRE to ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ source package, use the following command to download and install PCRE compiled package
I have to download software / software / nginx
Nginx installation requires depends on gcc, openssl-devel, pcre-devel, zlib-devel
1, install openssl
yum install openssl
2. Download the software Rewrite configuration using pcre
cd / software / nginx
http://jaist.dl.sourceforge.net/project/pcre/pcre/8.32/pcre-8.32.zip
unzip pcre-8.32.zip
cd pcre-8.32
./configure
make
make install
3, install zlib
cd / software / nginx
wget http://zlib.net/zlib-1.2.7.tar.gz
tar -zxvf zlib-1.2.7.tar.gz
cd zlib-1.2.7
./configure
make
make install
4, Nginx software download
http://nginx.org
Installation and Configuration
./configure -prefix = / usr / local / nginx -with-pcre = / software / nginx / pcre-8.32 -with-http_ssl_module -with-http_stub_status_module -with-http_sub_module
make
make install
Note: -with-pcre = / software / nginx / pcre-8.32 means that the source path pcre-8.32
In nginx.conf the server to add:
rewrite_log on;
error_log logs / rewrite.error.log notice; # can view rewrite is correct
5, start Nginx
/ Usr / local / nginx / sbin / nginx -t # test configuration file is correct
Appear as the right:
/ Usr / local / nginx / sbin / nginx # start Nginx
As the following error:
/ Usr / local / nginx / sbin / nginx: error while loading shared libraries: libpcre.so.1: can not open shared object file: No such file or directory
Solution is as follows:
On RedHat 64-bit machines, pcre file nginx might read is /lib64/libpcre.so.1 file.
ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1
ln -s /lib/libpcre.so.0.0.1 /lib/libpcre.so.1 |
|
|
|