Centos7 安装 Tengine

yum install -y gcc gcc-c++

PCRE.

wget https://netix.dl.sourceforge.net/project/pcre/pcre/8.40/pcre-8.40.tar.gz
tar -zxvf pcre-8.40.tar.gz
cd pcre-8.40

./configure
make && make install

pcre-config --version

OPENSSL.

cd /usr/local/src
wget http://www.openssl.org/source/openssl-1.0.2.tar.gz
tar zxvf openssl-1.0.2.tar.gz
cd openssl-1.0.2
./config
make && make install

ZLIB.

cd /usr/local/src
wget http://zlib.net/zlib-1.2.11.tar.gz
tar zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make && make install

HEADERS.

cd /usr/local/src
git clone https://github.com/openresty/headers-more-nginx-module.git

TENGINE.

cd /usr/local/src
wget http://tengine.taobao.org/download/tengine-2.2.0.tar.gz
tar -zxvf tengine-2.2.0.tar.gz
cd tengine-2.2.0
./configure --prefix=/usr/local/nginx \ --with-pcre=/usr/local/src/pcre-8.40 \


--with-openssl=/usr/local/src/openssl-1.0.2 \


--with-zlib=/usr/local/src/zlib-1.2.11 \


--add-module=/usr/local/src/headers-more-nginx-module \


--with-http_v2_module


make && make install


Service.

vim /lib/systemd/system/nginx.service

[Unit]
Description=The nginx HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

chmod 745 nginx.service

systemctl enable nginx.service