1、解压安装包
[root@localhost src]# tar xf tengine-2.3.3.tar.gz
[root@localhost src]#
2、cd到解压目录并编译安装
[root@localhost src]# cd tengine-2.3.3
[root@localhost tengine-2.3.3]# ls
AUTHORS.te  CHANGES     CHANGES.te  configure  docs  LICENSE   man      objs      README.markdown  tests
auto        CHANGES.cn  conf        contrib    html  Makefile  modules  packages  src              THANKS.te
[root@localhost tengine-2.3.3]# ./configure  --prefix=/apps/tengine --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-stream_ssl_module --with-stream_realip_module
*
*
*
[root@localhost tengine-2.3.3]# make
*
*
*
[root@localhost tengine-2.3.3]# make install
*
*
*
[root@localhost tengine-2.3.3]# cd /apps/tengine/
[root@localhost tengine]# ls
conf  html  logs  sbin
[root@localhost tengine]# 
3、编辑配置文件
[root@localhost conf]# ls
fastcgi.conf          fastcgi_params          koi-utf  mime.types          nginx.conf          scgi_params          uwsgi_params          win-utf
fastcgi.conf.default  fastcgi_params.default  koi-win  mime.types.default  nginx.conf.default  scgi_params.default  uwsgi_params.default
[root@localhost conf]# vim nginx.conf
//编辑nginx.conf,并且在文件http模块的末尾处添加下面的内容
include /apps/nginx/conf/server/*.conf;
4、检查tengine的版本
[root@localhost conf]# /apps/tengine/sbin/nginx -V
Tengine version: Tengine/2.3.3
nginx version: nginx/1.18.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/apps/tengine --user=nginx --group=nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-stream_ssl_module --with-stream_realip_module
5、配置tengine日志信息

在nginx.conf文件中添加如下信息

  log_format access_json '{"@timestamp":"$time_iso8601",'
    '"host":"$server_addr",'
    '"clientip":"$remote_addr",'
    '"size":$body_bytes_sent,'
    '"responsetime":$request_time,'
    '"upstreamtime":"$upstream_response_time",'
    '"upstreamhost":"$upstream_addr",'
    '"http_host":"$host",'
    '"uri":"$uri",'
    '"domain":"$host",'
    '"xff":"$http_x_forwarded_for",'
    '"referer":"$http_referer",'
    '"tcp_xff":"$proxy_protocol_addr",'
    '"http_user_agent":"$http_user_agent",'
    '"status":"$status"}';

6、启动tengine并访问之前玩耍nginx时配置的域名mobile.hu.com或者pc.hu.com,并f12检查http相应信息显示的server是否是tengine

[root@localhost conf]# /apps/tengine/sbin/nginx 
[root@localhost conf]# ps -ef|grep nginx
root       4433   1080  0 05:26 pts/1    00:00:00 vim nginx.conf
root       4441      1  0 05:30 ?        00:00:00 nginx: master process /apps/tengine/sbin/nginx
nginx      4442   4441  0 05:30 ?        00:00:00 nginx: worker process
root       4444   1056  0 05:30 pts/0    00:00:00 grep --color=auto nginx