Nginx installation in lnmp environment and nginx in lnmp Environment

Source: Internet
Author: User

Nginx installation in lnmp environment and nginx in lnmp Environment

1. What is nginx?
1) Nginx is a lightweight Web server/reverse proxy server and email proxy server, which is released under a BSD-like protocol.
2) features: it has a small amount of memory and is capable of concurrent sending. In fact, nginx's concurrency is indeed good in the same type of Web server.

1. Preparations before installation:

# First, check whether the compilation package and some dependent packages are installed.
# Yum install gcc-c ++ openssl-devel zib

2. Install pcre
# Wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
# Tar zxvf pcre-8.39.tar.gz
Compile and install
# Cd pcre-8.39
#./Configure -- prefix =/usr/local/pcre
# Make & make install

3. Install nginx
# Wget http://nginx.org/download/nginx-1.6.2.tar.gz
# Tar-zxvf nginx-1.6.2.tar.gz
# Cd nginx-1.6.2
#./Configure -- prefix =/usr/local/nginx -- with-pcre = usr/local/pcre -- with-http_stub_status_module
# Make & make install

5. Start nginx
Check the nginx Configuration File Syntax.
#/Usr/local/nginx/sbin/nginx-t
If not, the following message is displayed:
Nginx: the configuration file/usr/local/nginx-1.4.6/conf/nginx. conf syntax is OK
Nginx: configuration file/usr/local/nginx-1.4.6/conf/nginx. conf test is successful

Start nginx
#/Usr/local/nginx/sbin/nginx
Reload nginx
#/Usr/local/nginx/sbin/nginx-s reload

There is no error in this step, so you can access the ip address.

 

Ii. troubleshooting during installation:

1. Solve nginx: [error] open () "/usr/local/nginx/logs/nginx. pid" failed error

Solution:
[Root @ localhost nginx] #/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx. conf

2. solution./configure: error: the HTTP rewrite module requires the PCRE library.

# Yum-y install pcre-devel

The above is for personal installation and is for reference only!

 

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.