NginxApacheSmokeping installation configuration detailed process

Smokeping installation configuration 1. Introduction smokeping is by Tobi the author of rrdtool Oetiker’s work, so it has great advantages in graphic display, and it is also a very characteristic opensource tool: a variety of detection methods, including fping, echoping, dig, curl, etc.; Easy-to-use and extensible plug-ins; The working mode of master/slave can collect the data of the same monitoring point on multiple nodes; the distinctive alert setting is not just a simple setting of a threshold; 2. Installation After installing LAMP and PERL, install the following software Smokeping need few perl module and other package to run. 1. RRDtools Download here : http://oss.oetiker.ch/rrdtool/ 2. FPing Download here : http://www.fping.com/ 3. EchoPing Download here : http://echoping.sourceforge.net/ 4. Curl Download here : http://curl.haxx.se/ 5. Dig Download here: http://www.isc.org/sw/bind/ 6. SSH Download here : http://www.openssh.org/ Various Perl Module Download here : http://www.cpan.org/ 1. libwww-perl 2. Socket6 0.11-1 3. Net::Telnet 4. Net::DNS 5. Net::LDAP 6. IO::Socket::SSL 7. Authen::Radius http://fping.sourceforge.net/download/fping.tar.gz http://daemoninc.com/SpeedyCGI/CGI-SpeedyCGI-2.22.tar.gz http://sourceforge.net/projects/echoping/files/echoping/6.0.2/echoping-6.0.2.tar.gz/download http://oss.oetiker.ch/smokeping/pub/smokeping-2.4.2.tar.gz My rrdtool chooses yum If you compile with , change the configuration file The use of two libs Install fping tar zxvf fping.tar.gz cd fping-2.4b2_to/ ./configure make && make install Install CGI-SpeedyCGI tar Czxvf CGI-SpeedyCGI-2.22.tar.gz cd CGI-SpeedyCGI-2.22 perl Makefile.PL Compile mod_speedycgi…

Puppet uses Nginx multi-port to achieve load balancing

As the company’s application requirements increase, continuous expansion is required, and the number of servers also increases. When the number of servers continues to increase, we will find that a puppetmaster is under great pressure, slow in parsing, and “time out” and other errors, is there any way to optimize it at this time? We searched for solutions on the Puppet official website and found that puppetmaster can be configured with multiple ports, combined with WEB proxy (Nginx is recommended), so that the puppetmaster’s capacity can be increased by at least several times The above is equivalent to optimizing the processing capabilities of puppet to a large extent. 1. Following the previous environment settings, our server environment and software version here are: Server system: CentOS5.8 x86_64 Ruby version: ruby-1.8.5 Puppet version: puppet-2.7.9 Nginx version: nginx-0.8.46 2. Mongrel installation To use puppet multi-port configuration, you need to specify the mongrel type, which is not installed by default and needs to be installed: yum install -y rubygem-mongrel 3. Configure puppet master Add the following two lines at the end of the /etc/sysconfig/puppetmaster file, representing multi-port and mongrel types respectively, and the contents are as follows: PUPPETMASTER_PORTS=(8141 8142 8143 8144 8145) PUPPETMASTER_EXTRA_OPTS=”–servertype=mongrel –ssl_client_header=HTTP_X_SSL_SUBJECT”…

Configure reverse proxy with Nginx/Lighttpd

Reverse proxy service has been more and more widely used in high-load Web sites, often used as Reverse Proxy includes Squid, Apache, Lighttpd, Nginx, etc. The latter two lightweight applications have quickly occupied a large number of markets because of their excellent performance. This article only discusses the simple applications of the latter two (using proxy to process static files and dynamic The file is handed over to the back-end Web server for processing) Installation environment OS: Debian 4.0 r3 Kernel: 2.6.18-6-686 Software List nginx-0.6.31.tar.gz lighttpd-1.4.19.tar.gz Installation Process Install nginx as a reverse proxy # tar zxvf nginx-0.6.31.tar.gz # cd nginx-0.6.31 # ./configure –prefix=/usr/local/nginx –with-http_realip_module # make && make install # vi /usr/local/nginx/conf/nginx.conf location / { proxy_pass http://10.10.10.87/; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 4k; proxy_buffers 4 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } # Static files location location ~* ^.+.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf |js|htm|html)$ { root /srv/www/htdocs/; } start nginx # /usr/local/nginx/sbin/nginx Install lighttpd as a reverse proxy # tar zxvf lighttpd-1.4.19.tar.gz # cd lighttpd-1.4.19 # ./configure –prefix=/usr/loca/lighttpd –without-bzip2 # make && make install # cp doc/lighttpd.conf /etc/lighttpd.conf # vi /etc/lighttpd.conf server.modules = ( “mod_access”, “mod_status”,…

Nginx configures reverse proxy to realize thief

Brother Si once reposted an article “How Nginx Reverse Proxy and Replaces URLs”. Although he didn’t steal the content of other people’s sites, the basic process has been realized. Yesterday, someone asked the public service how to use the anti-generation of nginx to realize the thief function according to the tutorial based on the lnmp one-key package of Junge. The public service briefly writes the idea here. Install some preparatory software yum -y –noplugins install wget zip yum -y –noplugins install unzip yum -y –noplugins install gcc yum -y –noplugins install make yum -y –noplugins install pcre-devel yum -y –noplugins install openssl-devel yum -y install subversion Download software wget -c http://www.nginx.org/download/nginx-1.0.8.tar.gz wget -c http://wiki.nginx.org/images/5/51/Nginx-accesskey-2.0.3.tar.gz svn checkout http://substitutions4nginx.googlecode.com/svn/trunk/substitutions4nginx-read-only compile software tar -zxf Nginx-accesskey-2.0.3.tar.gz tar zxf nginx-1.0.8.tar.gz cd nginx-1.0.8 ./configure –user=www –group=www –prefix=/usr/local/nginx –with-http_stub_status_module –with-http_ssl_module –with-ipv6 –with-http_gzip_static_module –with-ipv6 — with-pcre –with-http_sub_module –add-module=/root/substitutions4nginx-read-only –add-module=/root/nginx-accesskey-2.0.3 If there are no errors in the compilation, then execute: make but do not make install After compiling, there is an nginx execution in the objs directory line file, first back up the original old nginx file, execute: mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old , and then cp the nginx under the new objs to sbin, Execution: cp objs/nginx /usr/local/nginx/sbin/nginx Execute the…

Nginx+Keepalived dual master configuration

Nginx+Keepalived dual master configuration

1. Architecture In the Keepalived + Nginx high-reliability load balancing architecture, keepalived is responsible for achieving High-availability (HA) The function controls the VIP (virtual network address) of the front-end machine. When a device fails, the hot standby server can automatically switch over to the VIP in an instant. In actual operation, the switching time is only 2 seconds. The DNS service can be responsible for the front-end VIP. load balancing. 2. Topology 3. Simple principle Both Nginx-Keepalived-M (nginx master server) and Nginx-Keepalived-S (standby server) use keepalived software to tie the eth0 network card to a virtual IP (VIP1) address: 172.16.1.20 , this VIP1 is currently bound to whose eth0 is whoever carries the service. When Nginx-Keepalived-M fails, Nginx-Keepalived-S will pass the heartbeat time advert_int set in the /etc/keepalived/keepalived.conf file 1 check, unable to obtain the normal state of Nginx-Keepalived-M, switch to Nginx-Keepalived-S instantly to achieve hot dual-machine load balancing, when Nginx-Keepalived-M recovers, keepalived will pass the priority Parameter judgment priority Rebind the virtual VIP1 address 172.16.1.20 to the eth0 network card of Nginx-Keepalived-M; similarly, the virtual IP (VIP2) address 172.16.1.21 regards the previous Nginx-Keepalived-S as the main server, Nginx -Keepalived-M is used as a secondary server to achieve load balancing…

Detailed interpretation of Nginx configuration file content

Here, record the configuration file description of the Nginx server nginx.conf, some comments collection and network. #running user user www-data; #Start the process, usually set to be equal to the number of cpu worker_processes 1; #Global error log and PID file error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; #Working mode and connection limit events { use epoll; #epoll is multiplexed IO(I/O Multiplexing), but only for kernels above linux2.6, can greatly improve the performance of nginx Worker_connections 1024; #Single background worker The maximum number of concurrent connections of the process # multi_accept on; } #Set up the http server, use its reverse proxy function to provide load balancing support http { #Set the mime type, which is defined by the mime.type file include /etc/nginx/mime.types; default_type application/octet-stream; #Set log format access_log /var/log/nginx/access.log; The #sendfile directive specifies whether nginx calls the sendfile function (zero copy method) to output files, for common applications, #Must be set to on, if it is used for downloading and other applications with heavy loads of disk IO, it can be set to off, to balance disk and network I/O processing speed and reduce system uptime. sendfile on; #tcp_nopush on; #Connection timeout #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; #Open gzip compression gzip…

Steps for Nginx to configure ssl certificate

Nginx (pronounced “engine x”) It is a high-performance HTTP and reverse proxy server, which occupies less memory than Apache, and also supports HTTPS access (SSL encryption) like Apache. This tutorial is based on Ubuntu Lucid (10.04), briefly explain how to deploy HTTPS website on Nginx. 1. Definition of terms CA (Certificate Authority): The abbreviation of digital certificate certification center, which refers to the organization that issues, manages, and revokes digital certificates. The role of the CA is to check the legitimacy of the identity of the certificate holder, issue the certificate (sign on the certificate), prevent the certificate from being forged or tampered with, and manage the certificate and key. SSL (Secure Sockets Layer): Secure Sockets Layer, which specifies a mechanism to provide data security layering between application protocols (such as HTTP, Telnet, FTP) and TCP/IP, it is in the transmission communication protocol A security protocol implemented on the protocol (TCP/IP), using public key technology, it provides data encryption, server authentication, message integrity, and optional client authentication for TCP/IP connections. Certificate chain (certificate chain): contains the trust anchor (CA certificate) and signed certificates. Web browsers come preconfigured with a set of root CA certificates that the browser automatically trusts. All…

How to use the location directive in the LinuxNginx configuration file

location Syntax: location [=|~|~*|^~] /uri/ { … } default: no context: server This directive accepts different structures depending on the URL. You can configure to use regular strings and regular expressions. If using regular expressions, you must use ~* The prefix selects a case-insensitive match or ~ selects a case-sensitive match. determine which location Directives match a specific directive, regular strings are tested first. The regular string matches the beginning of the request and is case-sensitive, the most specific match will be used (see below to understand nginx how to determine it). The regular expressions are then tested in the order in the configuration file. Finding the first matching regular expression will stop the search. If no matching regular expression is found, the regular string result is used. There are two ways to modify this behavior. The first method is to use “=” prefix, will only perform strict matching. If the query matches, the search will stop and the request will be processed immediately. Example: If “/” requests occur frequently, use “location = /” will speed up the processing of this request. The second is to use the ^~ prefix. Using this prefix with a regular string tells nginx not…

CentOS6.5 uses yum to install Linux+Nginx+PHP+MySQL (LNMP) environment

Recently took over and maintained a Linux server, Centos6 version, the customer wants to convert from Apache to Nginx. Upgrade PHP to the latest version at the same time Configure Nginx1.0.10+PHP5.3.8(fastcgi)+Mysql5.5.17+eAccelerator as follows (the relevant version number is the latest version of the source software package) Use Nginx official source, Epel extension library and remi source, remi source is based on epel, you must install epel source first, remi contains php-fpm, mysql-server5.5, if you only need php-fpm, you can use it separately Disable this source after installing php-fpm. Install Nginx source: rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm Install the EPEL source: (64-bit system) rpm -ivh http://download.Fedora.RedHat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm (32-bit system) rpm -ivh http://download.Fedora.RedHat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm Install the REMI sources: rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm Open REMI, edit /etc/yum.repos.d/remi.repo vi /etc/yum.repos.d/remi.repo Modify enable=1 esc :wq yum -y install nginx mysql-server php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator 1. Configure the nginx configuration file according to the requirements (this blog post does not provide specific configuration) 2. Modify /etc/php-fpm.conf user group to nginx 3. Modify /var/lib/php/session (so that php can save the session), and the web user group is nginx chown -R nginx:nginx /var/lib/php/session (you need to create if it does not exist) chown -R…

openresty-Nginx+lua+redis reverse proxy application server

1. Installation configuration Download and install from this URL at http://openresty.org/. 2. nginxReverse proxy application server Question 2.1: What is an application server? In fact, it is to let nginx have the ability to handle business. For example: mysql, redis Reading and writing data; sending socket requests; screening processing of http requests or user authentication at the business layer, etc., are not listed here. Question 2.2: Why choose openresty? openresty is a framework combined with nginx+lua, which is said to have a concurrency capability of 10k+, but I have not actually verified it here. However, nginx with the best concurrent processing capabilities and simple and efficient lua are paired with redis; therefore, there is no need to question its processing capabilities. I believe there is no better combination. 3. Fixed URL reverse proxy Example: location /proxy2 { default_type text/html; set $flag ; set_by_lua $flag ‘ local args = ngx.req.get_uri_args() If args[“a”] == “” then return end return ‘; if ($flag ~ ) { return ; } proxy_pass http://127.0.0.1/example.php; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_max_temp_file_size ; proxy_connect_timeout ; proxy_send_timeout ; proxy_read_timeout ; proxy_buffer_size 4k; proxy_buffers 32k; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; } 4. Variable URL reverse…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索