Nginx installation (CentOS)

Source: Internet
Author: User
Tags openssl

First, install the compilation tool and the library file

Yum-y install make zlib zlib-devel gcc-c++ libtool OpenSSL openssl-devel  
second, the first to install PCRE

PCRE function is to let Ngnix support Rewrite function.

1, download PCRE installation package, download address: http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

[Root@bogon src]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

2, Decompression installation package:

[Root@bogon src]# tar zxvf pcre-8.35.tar.gz

3, into the installation package directory

[Root@bogon src]# CD pcre-8.35

4. Compile and install

[Root@bogon pcre-8.35]#./configure
[Root@bogon pcre-8.35]# make && make install

5, view Pcre version

[Root@bogon pcre-8.35]# Pcre-config--version
Install Nginx

1, download Nginx, download address: http://nginx.org/download/nginx-1.6.2.tar.gz

[Root@bogon src]# wget http://nginx.org/download/nginx-1.6.2.tar.gz

2, Decompression installation package

[Root@bogon src]# tar zxvf nginx-1.6.2.tar.gz

3, into the installation package directory

[Root@bogon src]# CD nginx-1.6.2

4. Compile and install

./configure && make && make install

5. After the installation completes, may start the Nginx:

/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf

There may be an error/usr/local/nginx/sbin/nginx:error while loading shared libraries:libpcre.so.1:cannot open Shared object File:no s Uch file or directory

Solution:

You can tell from the error message that the Lib file is missing and that the details are further viewed:

1 # LDD $ (Which/usr/local/nginx/sbin/nginx)
2 libpthread.so.0 =>/lib64/libpthread.so.0 (0x00000030e8400000)
3 Libcrypt.so.1 =>/lib64/libcrypt.so.1 (0x00000030f9a00000)
4 Libpcre.so.1 => not found
5 Libcrypto.so.6 =>/lib64/libcrypto.so.6 (0x00000030f2a00000)
6 Libz.so.1 =>/lib64/libz.so.1 (0x00000030e8800000)
7 Libc.so.6 =>/lib64/libc.so.6 (0x00000030e7800000)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.