Upload the Tengine compressed package tengine-2.1.0.tar.gz to the server via SSH.
Upload to/opt path
Decompression tengine-2.1.0.tar.gz
TAR-ZXVF tengine-2.1.0.tar.gz
Access to the Tengine directory
CD tengine-2.1.0
Installation of Tengine dependencies
Yum-y Install gcc openssl-devel pcre-develzlib-devel
Compilation Three steps away
./configure \
--prefix=/opt/sxt/soft/tengine-2.1.0/\
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--http-client-body-temp-path=/var/tmp/nginx/client/\
--http-proxy-temp-path=/var/tmp/nginx/proxy/\
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/\
--HTTP-UWSGI-TEMP-PATH=/VAR/TMP/NGINX/UWSGI \
--HTTP-SCGI-TEMP-PATH=/VAR/TMP/NGINX/SCGI \
--with-pcre
Make && make install
Create an nginx file under/ETC/INIT.D
Vi/ect/init.d/nginx
Paste the content below
#!/bin/bash## chkconfig: - 85 15# description: nginx is a world Wide Web server. It is used to serve# Source function Library: /etc/rc.d/init.d/functions # source networking configuration. /etc/sysconfig/network # check that networking is up. [ "$NETWORKING" = "no" ] && exit 0 nginx= "/usr/tengine-2.1/ Sbin/nginx "prog=$ (basename $nginx) nginx_conf_file="/usr/tengine-2.1/conf/nginx.conf " #[ - f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx lockfile=/var/lock/ subsys/nginx #make_dirs () {# # make required directories# user= ' nginx -v 2>&1 | grep "configure arguments:" | sed ' s/[^*]*--user=\ ([^ ]*\). */\1/g ' -' # options= ' $nginx -V 2>&1 | grep ' configure arguments: ' # for opt in $options; do# if [ ' echo $opt | grep '. *-temp-path ' ]; then# value= ' echo $opt | cut -d "=" -f 2 ' # if [ ! -d "$value" ]; then# # echo "Creating" $value # mkdir -p $value && chown -R $user $value # fi# fi# donE#} start () { [ -x $nginx ] | | exit 5 [ -f $NGINX _conf_file ] | | exit 6# make_dirs echo -n $ "Starting $ prog: " daemon $nginx -c $NGINX _conf_file retval=$? echo [ $retval -eq 0 ] & & touch $lockfile return $retval} stop () { echo -n $ "stopping $prog: " killproc $prog - quit retval=$? echo [ $retval - eq 0 ] && rm -f $lockfile return $retval} restart () { configtest | | rEturn $? stop sleep 1 start} reload () { configtest | | return $? echo -n $ "reloading $prog: " # - HUP is the Nginx smooth restart parameter killproc $nginx -HUP Retval=$? echo} force_reload () { restart} Configtest () { $nginx -t -c $NGINX _conf_file} rh_status () { status $prog} rh_status_q () { rh_status >/dev/ null 2>&1} case "$" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q | | exit 0 $1 ;; restart|configtest) $1 ;; reload) rh_status_q | | exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q | | exit 0 ;; *) echo $ "Usage: $0 { Start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest} " exit 2esac
To replace a path in a text
Enter the Tengine installation directory
cd/opt/sxt/soft/tengine-2.1.0/
Pwd
Copy the installation directory
nginx= "/usr/tengine-2.1/sbin/nginx"
Modify Nginx's Execute permissions
chmod 755 Nginx
Create Directory/var/tmp/nginx/client/
Mkdir-p/var/tmp/nginx/client/
Start Nginx Service
Service Nginx Start
Add to boot
Chkconfig--add Nginx
Viewing the status of Nginx boot-up
Chkconfig--list Nginx
Change Nginx boot status
Chkconfig Nginx on
Check the status Chkconfig--list Nginx again
View IP, enter IP in the browser to see if the installation was successful
Ifconfig
inet addr:192.168.153.129
See in the browser
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/A4/72/wKioL1mru7LiFEx3AAATbyRUIsY240.png "title=" f% P8fo0v6a[[civt ']h9[yd.png "alt=" Wkiol1mru7lifex3aaatbyruisy240.png "/>
Indicates successful installation
CentOS6.5 installing Tengine server in VMware