Nginx installation (1)-nginx in the ttlsa tutorial Series

Source: Internet
Author: User
Tags install openssl openssl library

Today, nginx is becoming increasingly popular. I remember that it was only 1.0.6 in 2011. Now it has been updated to 1.5.1, and nginx is updated faster and faster. I have always wanted to record a series of nginx tutorials for various reasons and have not done them. This year I took the time to complete the nginx I used in my daily work. I will follow the tutorial in the future. Of course, the article goes first, and the next article will talk about nginx virtual host configuration. If you have any suggestions, please leave a message.

1. necessary software preparation
  • Install PCRE

To support rewrite, We need to install PCRE

# Yum install PCRE * // if you have installed it, skip this step.
  • Install OpenSSL

SSL support is required. skip this step if SSL support is not required.

# yum install openssl*
2, Install nginx

Run the following command:

# ./configure --prefix=/usr/local/nginx-1.5.1 \
--with-http_ssl_module --with-http_spdy_module \
--with-http_stub_status_module --with-pcre

-With-http_stub_status_module: Support for nginx status query
-With-http_ssl_module: Support for HTTPS
-With-http_spdy_module: support Google spdy, would like to know Baidu spdy, this must have SSL support
-With-PCRE: To support rewrite, you must specify a PCRE

The output is as follows, indicating that configure is OK.
.....

checking for zlib library ... found
 creating objs/Makefile
Configuration summary
 + using system PCRE library
 + using system OpenSSL library
 + md5: using OpenSSL library
 + sha1: using OpenSSL library
 + using system zlib library
nginx path prefix: "/usr/local/nginx-1.5.1"
 nginx binary file: "/usr/local/nginx-1.5.1/sbin/nginx"
 nginx configuration prefix: "/usr/local/nginx-1.5.1/conf"
 nginx configuration file: "/usr/local/nginx-1.5.1/conf/nginx.conf"
 nginx pid file: "/usr/local/nginx-1.5.1/logs/nginx.pid"
 nginx error log file: "/usr/local/nginx-1.5.1/logs/error.log"
 nginx http access log file: "/usr/local/nginx-1.5.1/logs/access.log"
 nginx http client request body temporary files: "client_body_temp"
 nginx http proxy temporary files: "proxy_temp"
 nginx http fastcgi temporary files: "fastcgi_temp"
 nginx http uwsgi temporary files: "uwsgi_temp"
 nginx http scgi temporary files: "scgi_temp"
# Make // make sure that make is installed on your server. If not, execute Yum install make
 # make install
3. Start, close, and reset nginx

Start: directly execute the following command to start nginx. You do not need to change any configuration file. For nginx configuration of multi-domain virtual hosts, refer to subsequent articles.

/usr/local/nginx-1.5.1/sbin/nginx

Try to access: I don't need to map this site. I directly use the curl command to read Web information.

[[email protected] conf]# curl -s http://localhost | grep nginx.com
nginx.com.

Close:

/usr/local/nginx-1.5.1/sbin/nginx -s stop

Reset: When you modify the configuration file, you only need to reload the following

/usr/local/nginx-1.5.1/sbin/nginx -s reload

The installation of nginx is now over.

Reprinted please indicate the source: http://www.ttlsa.com/html/1548.html

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.