Nginx Source Installation
1. Install the development Kit
# Yum install-y pcre-devel openssl-devel
2. Unzip the source package and edit the file hidden Nginx version
# Tar zxvf nginx-1.8.0.tar.gz
# CD nginx-1.8.0
# Vim AUTO/CC/GCC
#CFLAGS = "$CFLAGS-G" #注释掉这行, remove debug mode compilation, compile the program only hundreds of K
# Vim src/core/nginx.h
#define Nginx_version "1.8.0"
#defineNGINX_VER "Nginx" #修改此行, remove the back "nginx_version", in order to secure
This will not get the Nginx version number after compiling.
3. Compiling and installing
#./configure--help #查询都可以安装那些模块
# ./configure--prefix=/usr/local/lnmp/nginx--with-http_ssl_module--with-http_stub_status_module
# Make && makeinstall
Note:
Http_ssl_module Start HTTP Encryption
The Http_sub_module module is a filter that modifies strings in the response content of the Web site, for example, you want to replace the ' Ttlsa ' in the response with the ' Operation Survival Time '.
4. Links for easy invocation and modification
# Cd/usr/local/lnmp/nginx/sbin
# Ln-s/usr/local/lnmp/nginx/sbin/nginx/usr/local/sbin
5. Detect syntax, open Nginx service, load configuration file
# nginx-t
# Nginx
# Nginx-s Reload
6. Check to see if port 80 is turned on and detected (make sure the httpd service is turned off at this point):
# NETSTAT-ANTLP
TCP 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 7060/nginx
7. Login Detection
# curl-i localhost
http/1.1 OK
server:nginx/
date:wed, 08:42:21 GMT
Content-type:text/html
content-length:612
last-modified:wed, 08:31:20 GMT
Connection:keep-alive
ETag: "56960b58-264"
Accept-ranges:bytes
Visit http://10.1.16.173
650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s2.51cto.com/wyfs02/m00/86/e2/wkiol1fomquhzpmvaaaxe-rdkvg925.png-wh_500x0-wm_3-wmp_4-s_3607388368.png "title = "Image.png" alt= "Wkiol1fomquhzpmvaaaxe-rdkvg925.png-wh_50"/>
This article is from the "True Water No Fragrance" blog, please be sure to keep this source http://chengyanli.blog.51cto.com/11399167/1846736
Nginx Source Installation