Detailed installation graphics tutorials for Nginx and Tengine (under Linux)

Source: Internet
Author: User

Simple installation

    1. Install the dependent yum-y install gcc openssl-devel pcre-devel zlib-devel
    2. Compile three steps to go./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

3. Note: Be sure to copy and paste from windows

Create Nginx file under/etc/init.d, paste content, modify path

4. Modify Ngxin File Execution permissions

5. Configure Chkconfig

Write it in front.

Can see me this blog friend, is the need to have a certain foundation! can go to see my nginx/tengine in the category bar.

Tengine's Baidu Encyclopedia: http://baike.baidu.com/link?url=0SDDMdkr6vKPJ42XCoYUYgng0PNFMQQdKWS5dFwUl_uqvs9WxggKPY7nb9P1_ E4svvg-aykacnyh3z-k1onu_q

Step one: Download Tengine-2.1.0.tar.gz package (can also be installed online), upload and decompress

Step two: Imitate and write the Nginx service file we need

/ETC/INIT.D, are some registered start-up services.

#!/bin/bash
#
# Chkconfig:-85 15
# Description:nginx is a world Wide Web server. It's used to serve
# Source function library.
. /etc/rc.d/init.d/functions

# Source Networking configuration.
. /etc/sysconfig/network

# Check that networking are 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
$
;;
Stop
Rh_status_q | | Exit 0
$
;;
Restart|configtest)
$
;;
Reload
Rh_status_q | | Exit 7
$
;;
Force-reload)
Force_reload
;;
Status
Rh_status
;;
Condrestart|try-restart)
Rh_status_q | | Exit 0
;;
*)
echo $ "Usage: $ {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
Exit 2
Esac

Step Three:

    1. Compile three steps to go./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

In this step, download the dependency, perhaps you will report some errors, need to solve their own!

Step Four:

Make && make install

Step five: Must be VI new Nginx AH!

    1. Note: Be sure to copy and paste from Windows.

Create Nginx file under/etc/init.d, paste content

Step Six: Modify Nginx

modifying paths

Will

Switch

Step Seven: Modify the Ngxin File execution permissions

Step eight: That's why the importance of step five

Step Nine:

All done!

Summarize

A Chapter One: Nginx usage scenario, compile and install Nginx, add to start Service 2. Install Nginx, join to start service

1../configure--prefix=/usr/tengine

2. Make && make install

    1. Copy the Contents of Nginx (note that you do not upload files here, there will be coding problems) to/ETC/INIT.D, directory
    2. Modifying the Software Installation path

    1. Modifying the execution permissions of nginx files

chmod +x Nginx

    1. Add the file to the system service

Chkconfig--add Nginx

To see if a success was added

Chkconfig--list Nginx

Start, stop, Reload

Service Nginx Start|stop|reload

Htttpd

Detailed installation graphics tutorials for Nginx and Tengine (under Linux)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.