tengine

赵志龙:
./nginx -s stop

赵志龙:
./nginx -t

赵志龙:
requirepass 1234

 

 

CentOS 7上源码安装Tengine-2.3.2

CentOS 7上源码安装Tengine-2.3.2
Tengine是由互联网巨头淘宝发起的Web服务器项目。它在Nginx的基础上,针对大访问量网站的需求,添加了很多高级功能和特性。它的性能和稳定性已经在很多大型网站上得到了检验,比如淘宝,天猫等。Tengine不仅开源,而且团队核心成员都来自于淘宝、搜狗等互联网大厂。有着强大的互联网大厂支持和技术团队维护,而且经过多年的实践检验,我们可以放心的使用。下面将介绍如何在CentOS7安装Tengine,步骤如下:

编译工具&依赖库安装

  1. [root@localhost ~]# yum install gcc-c++
  2. [root@localhost ~]# yum install pcre
  3. [root@localhost ~]# yum install pcre-devel
  4. [root@localhost ~]# yum install pcre
  5. [root@localhost ~]# yum install zlib
  6. [root@localhost ~]# yum install zlib-devel
  7. [root@localhost ~]# yum install openssl
  8. [root@localhost ~]# yum install openssl-devel

Tengine 下载&解压安装

  1. [root@localhost ~]# wget http://tengine.taobao.org/download/tengine-2.3.2.tar.gz
  2. [root@localhost ~]# tar -zxvf tengine-2.3.2.tar.gz
  3. [root@localhost ~]# cd tengine-2.3.2

Tengine 编译&安装

  1. [root@localhost tengine-2.3.2]# ./configure
  2. [root@localhost tengine-2.3.2]# make
  3. [root@localhost tengine-2.3.2]# sudo make install

说明:默认情况下,tengine会被安装到/usr/local/nginx目录下

Tengine 目录说明

  1. [root@localhost tengine-2.3.2]# cd /usr/local/nginx
  2. [root@localhost nginx]# tree -d
  3. .
  4. ├── conf //配置文件目录
  5. ├── html //静态网页文件目录
  6. ├── logs //日志文件目录
  7. └── sbin //可执行文件目录

Tengine 启动&测试

  1. [root@localhost tengine-2.3.2]# cd /usr/local/nginx/sbin
  2. [root@localhost sbin]# ./nginx

然后使用浏览器访问测试

  1. http://192.168.100.100

如果看到如下页面,说明安装成功
tengine-index-page

Tengine 安装常见错误

1、如果出现如下错误提示,说明系统中没有安装gcc编译工具,我们只需要安装gcc-c++即可,

  1. [root@localhost tengine-2.3.2]# ./configure
  2. checking for OS
  3. + Linux 3.10.0-957.27.2.el7.x86_64 x86_64
  4. checking for C compiler ... not found
  5. ./configure: error: C compiler cc is not found

解决办法:

  1. [root@localhost tengine-2.3.2]# yum install gcc-c++

2、如果出现如下提示,表示缺少PCRE库:

  1. [root@localhost tengine-2.3.2]# ./configure
  2. ./configure: error: the HTTP rewrite module requires the PCRE library.
  3. You can either disable the module by using --without-http_rewrite_module
  4. option, or install the PCRE library into the system, or build the PCRE library
  5. statically from the source with nginx by using --with-pcre=<path> option.

解决办法:

  1. [root@localhost tengine-2.3.2]# yum install pcre
  2. [root@localhost tengine-2.3.2]# yum install pcre-devel

3、如果出现如下提示,表示缺少zlib库:

  1. [root@localhost tengine-2.3.2]# ./configure
  2. ./configure: error: the HTTP gzip module requires the zlib library.
  3. You can either disable the module by using --without-http_gzip_module
  4. option, or install the zlib library into the system, or build the zlib library
  5. statically from the source with nginx by using --with-zlib=<path> option.

解决办法:

  1. [root@localhost tengine-2.3.2]# yum install zlib
  2. [root@localhost tengine-2.3.2]# yum install zlib-devel

THE END

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;
#access_log "pipe:rollback logs/access_log interval=1d baknum=7 maxsize=2G" main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;


upstream tomcat_web {
server localhost:8080 weight=1 max_fails=2 fail_timeout=30s;
server localhost:81 weight=1 max_fails=2 fail_timeout=30s;
}


#gzip on;

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;
#access_log "pipe:rollback logs/host.access_log interval=1d baknum=7 maxsize=2G" main;

location / {


proxy_pass http://tomcat_web;



}

#error_page 404 /404.html;

# redirect server error pages to the static page

原文地址:https://www.cnblogs.com/zzl0916/p/13816088.html