为什么80%的码农都做不了架构师?>>>   

简介

Tengine是由淘宝网发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。官网

准备

  1. 下载:http://tengine.taobao.org/download_cn.html 下载 Tengine-2.x.x.tar.gz 的文件
  2. 系统环境 根据需要的功能模块,需要准备以下软件
    yum -y install autoconf automake libtool gcc gcc-c++ openssl openssl-devel
    rewrite 需要pcre库 pcre-8.32.tar.gz 官网
    gzip 需要zlib库 zlib-1.2.8.tar.gz 官网
    ssl 需要openssl 尽量用系统的openssl-devel
    lua 需要LuaJIT LuaJIT-2.0.4.tar.gz 官网
    lua 需要ngx_devel_kit ngx_devel_kit-0.2.19.tar.gz 官网
    lua 需要lua-nginx-module lua-nginx-module-0.9.20.tar.gz 官网
    cache 需要 ngx_cache_purge ngx_cache_purge-2.3.tar.gz 官网
    echo 需要 echo-nginx-module echo-nginx-module-0.58.tar.gz 官网
    geoip 需要 ngx_http_geoip_module ngx_http_geoip2_module-1.0.tar.gz 官网
    naxsi 需要 naxsi-core naxsi-0.51-1.tar.gz 官网
    jemalloc 需要 jemalloc jemalloc-4.0.4.tar.gz 官网

安装

  1. pcre
    tar xzf pcre-8.32.tar.gz  cd pcre-8.3.2  ./configure  make && make install
  1. zlib
    tar xzf zlib-1.2.8.tar.gzcd zlib-1.2.8./configuremake && make install
  1. jemalloc
    tar xzf jemalloc-4.0.4.tar.gzcd jemalloc-4.0.4./autogen.sh./configuremake && make install
  1. Tengine
tar xzf tengine-2.1.2.tar.gz
cd tengine-2.1.2
./configure --with-select_module --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_ssl_module --with-http_spdy_module --with-syslog --with-pcre=/usr/local/src/pcre-8.32 --with-jemalloc=/usr/local/src/jemalloc-4.0.4
make && make install

使用

1.设置为服务 保存以下代码到/etc/init.d/nginx

#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
# it is v.0.0.2 version.
# chkconfig: - 85 15
# description: Nginx is a high-performance web and proxy server.
#              It has a lot of features, but it's not for everyone.
# processname: nginx
# pidfile: /var/run/nginx.pid
# config: /usr/local/nginx/conf/nginx.conf
nginxd=/usr/local/nginx/sbin/nginx
nginx_config=/usr/local/nginx/conf/nginx.conf
nginx_pid=/var/run/nginx.pid
RETVAL=0
prog="nginx"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x $nginxd ] || exit 0
# Start nginx daemons functions.
start() {
if [ -e $nginx_pid ];then
echo "nginx already running...."
exit 1
fi
echo -n $"Starting $prog: "
daemon $nginxd -c ${nginx_config}
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/nginx
return $RETVAL
}
# Stop nginx daemons functions.
stop() {echo -n $"Stopping $prog: "killproc $nginxdRETVAL=$?echo[ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /var/run/nginx.pid
}
# reload nginx service functions.
reload() {echo -n $"Reloading $prog: "#kill -HUP `cat ${nginx_pid}`killproc $nginxd -HUPRETVAL=$?echo
}
# See how we were called.
case "$1" in
start)start;;
stop)stop;;
reload)reload;;
restart)stopstart;;
status)status $progRETVAL=$?;;
*)echo $"Usage: $prog {start|stop|restart|reload|status|help}"exit 1
esac
exit $RETVAL

2.设置为自启动

chmod 775 /etc/rc.d/init.d/nginx #赋予文件执行权限chkconfig nginx on #设置开机启动service nginx restart #启动服务

以上是基本功能,下期介绍常用模块的功能和用法

问题集合

扩展阅读

Tengine 官方中文文档

转载于:https://my.oschina.net/2688/blog/604303

Tengine 安装和基本使用相关推荐

  1. Tengine 安装配置全过程

    在先前的文章中介绍过Tengine,先前只是使用了运维人员配置好的内容,未自己进行过安装配置.周末闲来无事,对于Tengine进行了尝试性的安装.记录下面方便以后再做改进. Tengine官网上有个非 ...

  2. Tengine安装使用及配置

    Tengine安装使用及配置 1.下载Tengine安装包 官网:http://tengine.taobao.org/ 下载地址:http://tengine.taobao.org/download. ...

  3. tengine安装问题

    官方安装文档:http://tengine.taobao.org/document/install.html 首先安装了依赖的pcre,但是安装tengine的时候要指定pcre的安装包路径,而不是编 ...

  4. Nginx缓存的配置调优,Tengine安装和配置。

    反向代理缓存: nginx做为反向代理时,能够将来自upstream的响应缓存至本地,并在后续的客户端请求同样内容时直接从本地构造响应报文. 可以在http全局配置内定义缓存. http{ proxy ...

  5. 淘宝Web服务器Tengine安装

    简介 Tengine是由淘宝网发起的Web服务器项目.它在 Nginx 的基础上,针对大访问量网站的需求,添加了很多高级功能和特性.Tengine的性能和稳定性已经在大型的网站如 淘宝网 , 天猫商城 ...

  6. tengine安装及配置

    一.安装过程 1>下载 Download - The Tengine Web Server 找到下载包并且下载(Tengine-2.2.0.tar.gz) 2>解压 tar zxvf Te ...

  7. CentOS 7.4 Tengine安装配置详解(七)

    十六.缓存及缓存清理 1.修改node1配置文件nginx.conf: (1)在http配置段中增加如下代码: proxy_cache_path /usr/local/tengine/cache le ...

  8. Tengine-Lite 、Tengine安装-使用

    https://tengine-docs.readthedocs.io/zh_CN/latest/source_compile/compile_linux.html https://blog.csdn ...

  9. tengine简单安装_Tengine介绍和安装

    Tengine特性 继承Nginx-1.6.2的所有特性,兼容Nginx的配置: 动态模块加载(DSO)支持.加入一个模块不再需要重新编译整个Tengine: 支持SO_REUSEPORT选项,建连性 ...

最新文章

  1. php基础+jquery基础
  2. SpringBoot中怎样对外开放一个接口返回Json数据
  3. 什么是matlab中的fints函数,Matlab基本函数
  4. vue项目接口地址暴露_vue项目打包后可以配置接口地址的方法
  5. lyapunov指数 matlab计算_Matlab学习笔记1——B站台大课
  6. opencv环境搭建
  7. figma设计_如何在Figma中构建设计入门套件(第二部分)
  8. JAVA设计模式 - 工厂方法模式
  9. 【论文】最新图学习推荐系统综述 | Graph Learning Approaches to Recommender
  10. 12年前的 Linux bug 复活,DNS 缓存投毒攻击重现
  11. dubbo学习--导入eclipse异常Unbound classpath container(2)
  12. java 视频格式转换-ffmpeg
  13. Buddy(伙伴)系统分配器之分配page
  14. openwrt带宽测速
  15. 【Python计算机视觉】图像到图像的映射(单应性变换、图像扭曲)
  16. java汉字转拼音以及五笔码工具
  17. OCR:财务报表识别
  18. 计算机主机是啥意思,pc是什么_pc是什么意思
  19. 天邑ty1208z海思3798刷版本_[高安]天邑ty1208z晶晨s905lb免拆机强刷固件下载
  20. 目录 | Flink源码走读

热门文章

  1. 学习编写用例是开发者走向项目经理的必经之路(《编写有效用例》书评) ——“Jolt大奖精选丛书”有奖征文...
  2. Java学习_day007:数组与方法
  3. FMDB使用Cached Statement功能
  4. Swift2.0语言教程之类的方法
  5. Beaglebone Black的启动
  6. ​Unity资源Assetmport New Asset对话框
  7. outlook qr码在哪里_明日方舟兑换码在哪里输入 附1200合成玉兑换码
  8. fastjson 不转某些字段_fastjson 过滤不需要的字段或者只要某些字段
  9. “无路之门”,一款VR恐怖冒险游戏
  10. “诺奖风向标”沃尔夫奖出炉:数学颁给表示论,物理颁给激光