tengine的安装和部署,tengine安装部署


tengine的简介

   Tengine是由淘宝网发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和              特性。Tengine的性能和稳定性已经在大型的网站如淘宝网,天猫商城等得到了很好的检验。它的最终目标是打                 造 一个高效、稳定、安全、易用的Web平台。

      从2011年12月开始,Tengine成为一个开源项目,Tengine团队在积极地开发和维护着它。Tengine团队的核心成员来    自于淘宝、搜狗等互联网企业。Tengine是社区合作的成果,我们欢迎大家参与其中,贡献自己的力量。


一。安装过程

  1》下载

        http://tengine.taobao.org/download.html 找到下载包并且下载(Tengine-2.2.0.tar.gz

  2》解压

         tar zxvf Tengine-2.2.0.tar.gz  

  3》配置检查 

       进入解压后的目录  ./configure

[java] view plain copy
  1. 异常1:  
  2.    [root@bogon tengine]# ./configure  
  3. checking for OS  
  4.  + Linux 3.10.0-327.el7.x86_64 x86_64  
  5. checking for C compiler ... not found  
  6.    
  7. ./configure: error: C compiler cc is not found  
  8. 也就是c编译器 gcc找不到  
  9.   安装gcc  yum -y install gcc  
  10. 继续检查  
  11. 异常2:  
  12.  checking for PCRE library ... not found  
  13. checking for PCRE library in /usr/local/ ... not found  
  14. checking for PCRE library in /usr/include/pcre/ ... not found  
  15. checking for PCRE library in /usr/pkg/ ... not found  
  16. checking for PCRE library in /opt/local/ ... not found  
  17.    
  18. ./configure: error: the HTTP rewrite module requires the PCRE library.  
  19. You can either disable the module by using --without-http_rewrite_module  
  20.  缺少pcre和pcre-devel 安装 yum -y install pcre pcre-devel  
  21.  这里安装好后 可以通过  
  22.   Rpm -qa | grep pcre找到所有pcre的包  
  23.   Rpm -ql 完整包名  查看安装的路径  
  24.    
  25. 异常3:  
  26.  checking for OpenSSL library ... not found  
  27.  缺少openssl和openssl-devel 安装 yum -y install openssl openssl-devel  
  28.    
  29. 继续检测成功 可以同构日志看到 需要pcre openssl zlib(安装openssl自动安装)的库  
  30. checking for PCRE library ... found  
  31. checking for PCRE JIT support ... found  
  32. checking for OpenSSL library ... found  
  33. checking for zlib library ... found  
  34. creating objs/Makefile  
  35.    

4》安装

    Make && make install 安装完成 安装目录为/usr/local/nginx

找到 /usr/local/nginx/sbin/nginx -V 查看所有加载的模块

[java] view plain copy
  1. [root@bogon sbin]# ./nginx -V  
  2. Tengine version: Tengine/2.2.0 (nginx/1.8.1)  
  3. built by gcc 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)  
  4. TLS SNI support enabled  
  5. configure arguments:  
  6. nginx: loaded modules:  
  7. nginx:     ngx_core_module (static)  
  8. nginx:     ngx_errlog_module (static)  
  9. nginx:     ngx_conf_module (static)  
  10. nginx:     ngx_dso_module (static)  
  11. nginx:     ngx_events_module (static)  

 /usr/local/nginx/sbin/nginx start|stop|restart 启动和关闭ngix服务

 访问 http://ip地址(默认的端口为80)

 5》nginx命令参数

   nginx -m 显示所有加载的模块
   nginx -l 显示所有可以使用的指令
   nginx -t 检查nginx的配置文件是否正确
   nginx -s 启动nginx
   nginx -s reload 重启nginx
   nginx -s stop 停止nginx



查看nginx的日志
    cd /usr/local/nginx/logs     more error.log
使用nginx访问路径
    curl 地址







部署程序(模拟在一台机器上

  进入  cd/usr/local/nginx/conf      编辑nginx.conf

             如下图:在server上添加

                       max_fails===最多失败3次

                       fail_timeout=======30秒之内不会在访问这个tomcat

            

              如下图:在server里的location中添加划线问题

               


  在linux上起动一个项目(端口不能和nginx的端口冲突)查看端口进入tomcat的conf目录 vi server.xml

  在windows上也启动一个相同的项目======把项目放在tomcat的webapps目录下  进入tomcat的bin目录点击startup.bat启动项目

  

   以上是轮询算法=====可以在项目中稍微修改一下内容  可以在浏览器访问的时候看到效果

    第一次访问

刷新后的效果


相关内容

    暂无相关文章