Rate This Document
Findability
Accuracy
Completeness
Readability

Running Tengine

  1. Start Nginx using either of the following methods:
    Method 1: Start Nginx using a script.
    1
    /usr/local/tengine-nginx/sbin/nginx -c /usr/local/tengine-nginx/conf/nginx.conf
    

    Method 2: Start Nginx as a service (recommended). Add Nginx to the Service list, and then start the service using a command.

    1. Edit the /etc/init.d/nginx file.
      1. Open /etc/init.d/nginx.
        1
        2
        rm -rf /etc/init.d/nginx
        vim /etc/init.d/nginx
        
      2. Press i to enter the insert mode and add the following content to the file:
        #!/bin/bash
        # chkconfig: 2345 10 90
        # description: nginx
        case "$1" in
         'start')
            /usr/local/tengine-nginx/sbin/nginx -c /usr/local/tengine-nginx/conf/nginx.conf
            echo "$0_start";
            ;;
         'stop')
           /usr/local/tengine-nginx/sbin/nginx -s quit
           echo "$0_stop";
             ;;
        esac
      3. Press Esc, type :wq!, and press Enter to save the file and exit.
    2. Modify the permission on the /etc/init.d/nginx file.
      1
      2
      chmod 777 /etc/init.d/nginx
      ll /etc/init.d/nginx
      
    3. Add Nginx to the chkconfig management list.
      1
      chkconfig --add /etc/init.d/nginx
      
    4. Enable Nginx to automatically start upon OS startup.
      1
      chkconfig nginx on
      
    5. Start Nginx.
      1
      service nginx start
      

    If an error is reported during the startup, see Troubleshooting.

  2. Check the Tengine process.
    1
    ps -ef | grep nginx
    

    You can stop Nginx using one of the following methods. Stopping Nginx interrupts services. Exercise caution when performing this operation.

    • Stop Nginx using a script.
      1
      /usr/local/tengine-nginx/sbin/nginx -s quit
      
    • Stop Nginx using a process.
      1
      pkill nginx
      
    • Stop Nginx using the service.
      1
      service nginx stop