Compile and install nginx in centos, and add the nginx_upstream_check_module module
Source: Internet
Author: User
Compile and install nginx in centos, and add the nginx_upstream_check_module module. because two web servers are required, I think of reverse proxy and finally chose nginx as the reverse proxy server, to monitor the monitoring status of backend servers in real time, compile ng... compile and install nginx in centos, and add the nginx_upstream_check_module module. because two web servers are required, I think of reverse proxy and finally chose nginx as the reverse proxy server, to monitor the monitoring status of backend servers in real time, you need to patch nginx with nginx_upstream_check_module when compiling nginx. first download the nginx_upstream_check_module patch file wget. https://github.com/yaoweibin/nginx_upstream_check_module/archive/master.zip Unzip the unzip nginx_upstream_check_module-master.zip to move the unzipped file to the root directory mv. /nginx_upstream_check_module-master/root/health and then download the nginx compilation package, you can go to the official website to download, after the download, tar-zxvf nginx-1.3.15.tar.gz and then enter the nginx-1.3.15 to nginx nginx_upstream_check_module patch-p1 </root/health/check_1.2.6 +. patch and then you can compile and install the nginx server. before compiling, please solve the package dependency. you can install yum with the following command :. /configure -- prefix =/usr -- sbin-path =/usr/sbin/nginx -- conf-path =/et C/nginx. conf -- error-log-path =/var/log/nginx/error. log -- http-log-path =/var/log/nginx/access. log -- pid-path =/var/run/nginx. pid -- lock-path =/var/lock/nginx. lock -- user = nginx -- group = nginx -- 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/pro Xy/-- 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 -- add-module =/root/health make & make install the health status of the backend server is monitored with nginx startup and shutdown script vim/etc/init. d/nginx #! /Bin/bash # chkconfig:-85 15 # description: Nginx is a World Wide Web server. # processname: nginx =/usr/local/nginx/sbin/nginx conf =/usr/local/nginx/conf/nginx. conf case $1 in start) echo-n "Starting Nginx" $ nginx-c $ conf echo "done"; stop) echo-n "Stopping Nginx" killall-9 nginx echo "done"; test) $ nginx-t-c $ conf; reload) echo-n "Reloading Nginx" ps auxww | grep nginx | grep master | awk '{print $2}' | xargs kill-HUP echo "done"; restart) $0 stop $0 start; show) ps-aux | grep nginx; *) echo-n "Usage: $0 {start | restart | reload | stop | test | show} "; esac adds chmod + x/etc/init. d/nginx add nginx to the startup list. chkconfig -- add nginx let nginx start chkconfig -- level 35 nginx on at random.
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