1 minute read

pre-requisite:

  1. has a runable CentOS7 system
  2. the Linux system a static IP address

My local setup

  1. OS: Windows 10
  2. VM: VMware WorkStation 15
  3. Linux: CentOS 7.6

What is Tengine

It is based on the Nginx HTTP server and has many advanced features. Tengine has proven to be very stable and efficient on some of the top 100 websites in the world, including taobao.com and tmall.com.

Setup Steps

  1. download the lastest released version in this link.
  2. upload the downloaded tar to linux under ~ directory
    1. I personally use xftp
  3. tar -zxvf tengine-x.x.x
  4. cd tengine-x.x.x
  5. yum install -y gcc openssl-devel pcre-devel zlib-devel
  6. ./configure --prefix=/usr/local/tengine
  7. make && make install
  8. cd /usr/local/tengine
  9. cd sbin
  10. ./nginx
  11. verify nginx is started
    1. open browser in windows, input the ip address of vm
    2. ps -ef | grep nginx
  12. there is no good way to shut down nginx process started in this way
    1. kill -9 <process from above step>
  13. then let’s make nginx as a service which can be start/stop in a elegant way
    1. cd /etc/init.d/
    2. vi nginx
    3. copy the content from this file to nginx file
    4. chmod 777 nginx
    5. service nginx start

FAQ

  1. why I can see nginx process running, but cannot reach linux ip through Windows browser
    1. possibly because the firewall is opened, can disable it to avoid same issue
    2. solution
      1. systemctl stop firewalld
      2. systemctl disable firewalld
  2. when run service nginx start terminal get stuck
    1. open another terminalconnecting to same linux vm
    2. service nginx status
      1. get this error: PID file /var/run/nginx.pid not readable
      2. solutions
        1. vi /usr/local/tengine/conf/nginx.conf
        2. add one more line pid /var/run/nginx.pid;
        3. source /usr/local/tengine/conf/nginx.conf
        4. service nginx start