Tengine 2.1.2 (nginx/1.6.2) Installation Configuration, Taobao Web Server

Keywords: Ruby Nginx zlib OpenSSL

brief introduction

Tengine is a Web server project initiated by Taobao.com. On the basis of Nginx, it adds many advanced functions and features to meet the needs of large-scale visiting websites. Tengine's performance and stability have been well tested on large websites such as Taobao and Tianmao Mall. Its ultimate goal is to build an efficient, stable, secure and easy-to-use Web platform.

Characteristic

It inherits all the features of Nginx-1.6.2 and is compatible with the configuration of Nginx.
Dynamic Module Loading (DSO) support. Adding a module no longer requires recompiling the entire Tengine;
Supports SO_REUSEPORT option, and improves the company's performance to three times that of the official nginx.
It also supports HTTP v2 protocol and SPDY v3 protocol, and can use both protocols at the same time.
Streaming upload to HTTP back-end server or FastCGI server can greatly reduce the I/O pressure of the machine.
More powerful load balancing capabilities, including consistency hash module, session maintenance module, can also be active health checks on the back-end server, according to the status of the server automatically online and offline, and dynamic analysis of upstream domain names;
Input filter mechanism support. It is more convenient to write Web application firewall by using this mechanism.
Support setting the retry times of proxy, memcached, fastcgi, scgi, uwsgi when the back end fails
Dynamic scripting language Lua support. Extended function is very efficient and simple.
Supports log and log sampling in the form of pipe and syslog (local and remote);
Supports collecting Tengine running status by specified keywords (domain name, url, etc.);
Combining multiple CSS and JavaScript file access requests into one request;
Automatically remove blank characters and comments to reduce page size
The number of processes and the affinity of bound CPUs are automatically set according to the number of CPUs.
The load and resource occupancy of the monitoring system can protect the system.
Display error information which is more friendly to operation and maintenance personnel, so as to locate the error machine easily.
Stronger anti-attack (access speed limit) module;
More convenient command line parameters, such as compiled module lists, supported instructions, etc.
The expiration time can be set according to the type of access file.
……

Installation and deployment

Install dependency packages

yum install gcc g++ make

cd /usr/local/src
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
wget http://www.openssl.org/source/openssl-1.0.2g.tar.gz
wget http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2
wget http://tengine.taobao.org/download/tengine-2.1.2.tar.gz

Step 4: Install Pcre

tar zxvf pcre-8.38.tar.gz
cd pcre-8.38
./configure --prefix=/usr/local/pcre-8.38
make && make install

If an error is reported: configure: error: You need a C++ compiler for C++ support.

Execute installation: Yum install-y GCC gcc-c++.

Step 5: Install Zlib

cd ..
tar zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --prefix=/usr/local/zlib-1.2.8
make && make install

Step 6: Install OpenSSl

cd ..
tar zxvf openssl-1.0.2g.tar.gz
cd openssl-1.0.2g
./config --prefix=/usr/local/openssl-1.0.2g
make && make install

Step 7: Unzip jemalloc without installation

cd .. && tar jxvf jemalloc-3.6.0.tar.bz2

Step 8: Install Tengine

cd .. 
tar zxvf tengine-2.1.2.tar.gz
cd tengine-2.1.2
./configure --prefix=/usr/local/nginx \
--with-pcre=/usr/local/src/pcre-8.38 \
--with-zlib=/usr/local/src/zlib-1.2.8 \
--with-openssl=/usr/local/src/openssl-1.0.2g \
--with-jemalloc=/usr/local/src/jemalloc-3.6.0 \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-http_concat_module 
make && make install

View version

/usr/local/nginx/sbin/nginx -v

Step 9: Start tengine

After installation, start tengine with the following command

/usr/local/nginx/sbin/nginx

Posted by DoD on Fri, 22 Mar 2019 23:09:56 -0700