Tengine

安装依赖

yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel pcre-devel

检查www用户是否存在

cat /etc/group | grep www

创建www用户

/usr/sbin/groupadd www && /usr/sbin/useradd -g www www

开始安装

cd /usr/local/src && wget http://tengine.taobao.org/download/tengine-2.2.3.tar.gz && tar -zxvf tengine-2.2.3.tar.gz && cd tengine-2.2.3 && ./configure --prefix=/usr/local/nginx --with-ipv6 && make && make install
开机启动
cd /usr/lib/systemd/system && 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

加入软连接

ln -s /usr/local/nginx/sbin/nginx /usr/local/bin

开启服务
nginx start
重启服务
nginx restart
停止服务
nginx stop
查看服务状态
nginx status

你可能感兴趣的:(Tengine)