nginx入门
Posted 每周向前一小步
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx入门相关的知识,希望对你有一定的参考价值。
nginx特点
占用cpu/内存资源少,相对apache并发处理能力强
nginx安装
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
安装pcre? nginx要在rewrite时要解析正则表达式,PCRE是正则解析库
//下载tar包
wget http://nginx.org/download/nginx-1.13.7.tar.gz
tar -xvf nginx-1.13.7.tar.gz
抹去nginx的版本,该步非必需
[root@phoenix nginx-1.13.7]# cat src/core/nginx.h /* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #ifndef _NGINX_H_INCLUDED_ #define _NGINX_H_INCLUDED_ #define nginx_version 1013007 #define NGINX_VERSION "1.13.7" #define NGINX_VER "nginx/" NGINX_VERSION #ifdef NGX_BUILD #define NGINX_VER_BUILD NGINX_VER " (" NGX_BUILD ")" #else #define NGINX_VER_BUILD NGINX_VER #endif #define NGINX_VAR "NGINX" #define NGX_OLDPID_EXT ".oldbin" #endif /* _NGINX_H_INCLUDED_ */ [root@phoenix nginx-1.13.7]# sed -i -e ‘s/1.13.7//g‘ -e ‘s/nginx//WS/g‘ -e ‘s/"NGINX"/"WS"/g‘ src/core/nginx.h [root@phoenix nginx-1.13.7]# [root@phoenix nginx-1.13.7]# [root@phoenix nginx-1.13.7]# cat src/core/nginx.h /* * Copyright (C) Igor Sysoev * Copyright (C) Nginx, Inc. */ #ifndef _NGINX_H_INCLUDED_ #define _NGINX_H_INCLUDED_ #define nginx_version 1013007 #define NGINX_VERSION "" #define NGINX_VER "WS" NGINX_VERSION #ifdef NGX_BUILD #define NGINX_VER_BUILD NGINX_VER " (" NGX_BUILD ")" #else #define NGINX_VER_BUILD NGINX_VER #endif #define NGINX_VAR "WS" #define NGX_OLDPID_EXT ".oldbin" #endif /* _NGINX_H_INCLUDED_ */
cd nginx-1.13.7
./configure --prefix=/usr/local/nginx
make
make install
添加环境变量
export PATH=/usr/local/nginx/sbin:$PATH
以上是关于nginx入门的主要内容,如果未能解决你的问题,请参考以下文章
Cg入门20:Fragment shader - 片段级模型动态变色(实现汽车动态换漆)
Cg入门19:Fragment shader - 片段级模型动态变色