1.系统版本
2.关闭防火墙
3.关闭selinux
4.安装必要的编译环境
OpenSSL
zlib
5.安装tengine
wget
http://tengine.taobao.org/download/tengine-2.3.2.tar.gz
编译安装
./configure \
--with-http_stub_status_module \
--with-stream \
--with-pcre
make && make install
配置启动脚本
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
启动服务
systemctl start nginx
查看状态
6.访问web界面
7.查看版本