How do I configure nginx as failover reverse proxy load balancer in front of two Apache web servers under CentOS / RHEL 5.x?
nginx is a Web and Reverse proxy server. Nginx used in front of Apache Web servers. All connections coming from the Internet addressed to one of the Web servers are routed through the nginx proxy server, which may either deal with the request itself or pass the request wholly or partially to the main web servers.
Our Sample Setup
Internet–
|
============= |—- apache1 (192.168.1.15)
| ISP Router| |
============= |—- apache2 (192.168.1.16)
| |
| |—- db1 (192.168.1.17)
| |eth0 -> 192.168.1.11 ———-/
|-lb0==| /
| |eth1 -> 202.54.1.1 —-/
|
| |eth0 -> 192.168.1.10 ———-\
|-lb1==| / |—- apache1 (192.168.1.15)
|eth1 -> 202.54.1.1 —-/ |
|—- apache2 (192.168.1.16)
|
|—- db1 (192.168.1.17)
Where,
* lb0 – Linux box directly connected to the Internet via eth1. This is master load balancer.
* lb1 – Linux box directly connected to the Internet via eth1. This is backup load balancer. This will become active if master networking failed.
* 202.54.1.1 – This ip moves between lb0 and lb1 server. It is called virtual IP address and it is managed by keepalived.
* eth0 is connected to LAN and all other backend software servers are connected via eth0.
* nginx is installed on both lb0 and lb1. It will listen on 202.54.1.1. You need to configure nginx as reverse proxy server. It will connects to Apache1 and Apache2.
* Install httpd server on Apache#1 and Apache#2 server. Configure them to listen on 192.168.1.15:80 and 192.168.1.16:80. Do not assign public IP to this box. Only activate eth0 via LAN.
* Install MySQL / Oracle / PgSQL server on Db#1. Configure db server to listen on 192.168.1.17:$db_server_port. Do not assign public IP to this box. Only activate eth0 via LAN.
In short you need the following hardware:
* 2 load balancer reverse proxy servers (250GB SATA, 2GB RAM, Single Intel P-D930 or AMD 170s with RHEL 64 bit+keepalived+nginx)
* 2 Apache web servers (Software RAID-1, SCSI-73GBx2 15k disk, 6GB RAM, Dual Intel Xeon or AMD 64 bit CPU with RHEL 64 bit+Apache 2)
* 1 backup Apache web servers (Software RAID-1, SCSI-73GBx2 15k disk, 6GB RAM, Dual Intel Xeon or AMD 64 bit CPU with RHEL 64 bit+Apache 2)
* 1 database server (RAID-10, SCSI-73GBx4 15k disk, 16GB RAM, Dual Intel Xeon or AMD 64 bit CPU with RHEL 64 bit+MySQL 5)
* 1 Caching server (RAID-1, SCSI-73GBx2 15k disk, 8GB RAM, Dual Intel Xeon or AMD 64 bit CPU with RHEL 64 bit)
* 1 offsite backup server (RAID-6, 1TB SATAx4, 4GB RAM, Single Intel/AMD CPU with RHEL 64bit)
* Slave database, storage, pop3 and SMTP server as per requirements.
* Internet uplink 100Mbps+ or as per requirements.
Remove Unwanted Software From lb0 and lb1
Type the following commands:
# yum -y groupremove “X Window System”
# x=$(yum list installed | egrep -i ‘php|httpd|mysql|bind|dhclient|tftp|inetd|xinetd|ypserv|telnet-server|rsh-server|vsftpd|tcsh’ | awk ‘{ print $1}’)
# yum -y remove $x
# yum -y install bind-utils sysstat openssl-devel.x86_64 pcre-devel.x86_64 openssl097a.x86_64
# /usr/sbin/authconfig –passalgo=sha512 –update
# passwd root
The above will remove X windows and other unwanted software from both lb0 and lb1.
Install Nginx On Both lb0 and lb1
Type the following commands to download nginx, enter:
# cd /opt
# wget http://sysoev.ru/nginx/nginx-0.8.33.tar.gz
Untar nginx, enter:
# tar -zxvf nginx-0.8.33.tar.gz
# cd nginx-0.8.33
Configure nginx for 64 bit RHEL / CentOS Linux:
# ./configure –without-http_autoindex_module –without-http_ssi_module –without-http_userid_module –without-http_auth_basic_module –without-http_geo_module –without-http_fastcgi_module –without-http_empty_gif_module –with-openssl=/lib64
Sample outputs:
….
nginx path prefix: “/usr/local/nginx”
nginx binary file: “/usr/local/nginx/sbin/nginx”
nginx configuration prefix: “/usr/local/nginx/conf”
nginx configuration file: “/usr/local/nginx/conf/nginx.conf”
nginx pid file: “/usr/local/nginx/logs/nginx.pid”
nginx error log file: “/usr/local/nginx/logs/error.log”
nginx http access log file: “/usr/local/nginx/logs/access.log”
nginx http client request body temporary files: “client_body_temp”
nginx http proxy temporary files: “proxy_temp”
nginx http fastcgi temporary files: “fastcgi_temp”
…
Install the same:
# make
# make install
Create nginx User Account
Type the following commands to create a user account:
# useradd -s /sbin/nologin -d /usr/local/nginx/html -M nginx
# passwd -l nginx
Configure nginx As Reverse Proxy Load Balancer On Both lb0 and lb1
Edit /usr/local/nginx/conf/nginx.conf, enter:
# vi /usr/local/nginx/conf/nginx.conf
Update it as follows:
pid logs/nginx.pid;
user nginx nginx;
worker_processes 10;
events {
worker_connections 1024;
}
http {
default_type application/octet-stream;
## Common options ##
include options.conf;
## Proxy settings ##
include proxy.conf;
## lb domains ##
include emegano.com.conf;
}
Edit /usr/local/nginx/conf/options.conf, enter:
# vi /usr/local/nginx/conf/options.conf
Update it as follows:
## Size Limits
client_body_buffer_size 128K;
client_header_buffer_size 1M;
client_max_body_size 1M;
large_client_header_buffers 8 8k;
## Timeouts
client_body_timeout 60;
client_header_timeout 60;
expires 24h;
keepalive_timeout 60 60;
send_timeout 60;
## General Options
ignore_invalid_headers on;
keepalive_requests 100;
limit_zone gulag $binary_remote_addr 5m;
recursive_error_pages on;
sendfile on;
server_name_in_redirect off;
server_tokens off;
## TCP options
tcp_nodelay on;
tcp_nopush on;
## Compression
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 6;
gzip_http_version 1.0;
gzip_min_length 0;
gzip_types text/plain text/css image/x-icon application/x-perl application/x-httpd-cgi;
gzip_vary on;
## Log Format
log_format main ‘$remote_addr $host $remote_user [$time_local] “$request” ‘
‘$status $body_bytes_sent “$http_referer” “$http_user_agent” ‘
‘”$gzip_ratio”‘;
Edit /usr/local/nginx/conf/proxy.conf, enter:
## Proxy caching options
proxy_buffering on;
proxy_cache_min_uses 3;
proxy_cache_path /usr/local/nginx/proxy_temp/ levels=1:2 keys_zone=cache:10m inactive=10m max_size=1000M;
proxy_cache_valid any 10m;
proxy_ignore_client_abort off;
proxy_intercept_errors on;
proxy_next_upstream error timeout invalid_header;
proxy_redirect off;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 60;
Edit /usr/local/nginx/conf/emegano.com.conf, enter:
## Connect to backend servers via LAN ##
## Reverse Proxy Load Balancer Logic ##
upstream nixcraft {
server 192.168.1.15 weight=10 max_fails=3 fail_timeout=30s;
server 192.168.1.16 weight=10 max_fails=3 fail_timeout=30s;
# only comes alive when above two fails
server 192.168.1.23 weight=1 backup;
}
server {
access_log logs/access.log main;
error_log logs/error.log;
index index.html;
root /usr/local/nginx/html;
server_name emegano.com www.emegano.com subdomain.emegano.com;
## Only requests to our Host are allowed
if ($host !~ ^(Emegano.com|www.Emegano.com|subdomain.Emegano.com)$ ) {
return 444;
}
## redirect www to nowww
# if ($host = ‘www.Emegano.com’ ) {
# rewrite ^/(.*)$ http://Emegano.com/$1 permanent;
# }
## Only allow these request methods
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}
## PROXY – Web
location / {
proxy_pass http://nixcraft;
proxy_cache cache;
proxy_cache_valid 200 24h;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
proxy_ignore_headers Expires Cache-Control;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
Start nginx web server:
# /usr/local/nginx/sbin/nginx
# netstat -tulpn | grep :80
# echo ‘ /usr/local/nginx/sbin/nginx’ >> /etc/rc.local
Fire a webbrowser and type domain name such as Emegano.com:
http://Emegano.com
Tuesday, September 14, 2010
free-unlimited-listing-no-listing-fees-no-charge-for-addtional-pictures
Tired of Ebay drama. Tired of shelling out fees for listing items on ebay ? Got suspended from ebay ?
Well, if you are a genuine seller and is looking for an alternative of ebay, then you have come to the right place.
Recently while searching through internet, I was estranged to know that ebay is increasing it’s fees frequently.
And at the same time giving ad of lowest price ???
Must be making fool, that is why there are lots of dis-satisfied buyers.
Recently launched buyer protection is just a blank fire, else nothing.
With people knowing nothing, of where to go for lowest price, just dive into ebay & turn out being paying hefty money for a useless item. Even after disputing against the item, if the seller is good with ebay & paying more fees, then ebay will reject your dispute at one go! Which means your $ is gone .
Recently i came to know that Emegano Inc. a Multinational company, registered in Ciaro, has opened it’s branch for India Operation for eshopping. Also it is heavily funded by Ewestventures , a financial company in india. They are claiming to give 100% protection with jaw breaking lowest market rates.
Situation is pretty clear, they are not charging any kind of liting fees like ebay, instead they charge seller only for the item they sold. Even they just forward the fees to the seller. Even they have a slogan for the seller: where seller is bound to sell at a lower price than ebay & other sites, as they would be charging seller only FVF & transaction fees. So ultimate the buyer will get the profit. I wish them all the best for their business. Even i have been approached by them to list items. So if anyone interested, plz let me know, I will be happy to forward your details to them. You can mail them at: emegano@live.com
We would like to thank the many people over the years who have chosen Powertec Home Gym and those considering our strength Home Gym equipment for the first time.
Well, if you are a genuine seller and is looking for an alternative of ebay, then you have come to the right place.
Recently while searching through internet, I was estranged to know that ebay is increasing it’s fees frequently.
And at the same time giving ad of lowest price ???
Must be making fool, that is why there are lots of dis-satisfied buyers.
Recently launched buyer protection is just a blank fire, else nothing.
With people knowing nothing, of where to go for lowest price, just dive into ebay & turn out being paying hefty money for a useless item. Even after disputing against the item, if the seller is good with ebay & paying more fees, then ebay will reject your dispute at one go! Which means your $ is gone .
Recently i came to know that Emegano Inc. a Multinational company, registered in Ciaro, has opened it’s branch for India Operation for eshopping. Also it is heavily funded by Ewestventures , a financial company in india. They are claiming to give 100% protection with jaw breaking lowest market rates.
Situation is pretty clear, they are not charging any kind of liting fees like ebay, instead they charge seller only for the item they sold. Even they just forward the fees to the seller. Even they have a slogan for the seller: where seller is bound to sell at a lower price than ebay & other sites, as they would be charging seller only FVF & transaction fees. So ultimate the buyer will get the profit. I wish them all the best for their business. Even i have been approached by them to list items. So if anyone interested, plz let me know, I will be happy to forward your details to them. You can mail them at: emegano@live.com
We would like to thank the many people over the years who have chosen Powertec Home Gym and those considering our strength Home Gym equipment for the first time.
In Search of Ebay Alternative
<!-- ---->
Google is the Dad of Internet. So if you search Google for eBay scam, frauds, etc you will get a bunch of results. Where people’s are just crying for their hard earned money, and can’t do much as eBay is a big Giant. In the name of protecting money, I believe they have Ebay buyer protection, Think twice again, your Claim is 90% likely to be rejected by them, as it’s just an Ad campaign, to promote eBay for more attraction.
So do Ioffer.com where it would not protect your money, as you pay to the seller directly
The real Fact of these Ebay:
This is registered in USA also listed in USA stocks, Nice but these companies operate in different corner of the world as a Pvt firm.
For example In India they are registered as Ebay India Pvt Ltd, which means all profit they got, will go to them Only. You can say other market players like shopping.indiatimes.com , shopping.rediff.com etc . They just operate like Private Ltd here. Just sucking the blood out of India & other countries. The older version of the world has just been revised, where-as Britishers used to steal all things to their country.
In the name of transaction ebay charge Listing fees,Different types of selling fees, transaction fees & lots more. Never counted
And that Ebay fools buyer’s by displaying discounted price on their page. Lets say a seller list a pen cost 100$, then as ebay will charge him certain fees, Do you people think that seller will not insert that fees in his item price ???? So finally what ???
We the buyers are fool And to that our $ is also at stake cos we paid & our claim will take months of times to process or will get rejected.
Now for seller’s part, Ebay confider’s it seller’s as a Sweating Pig, where it can hunt him, at any matter of time.
(Still seller goes there )
Now, despite 4-5% transaction fees + 5%FVF (roughly) + Listings fees at lot more…..
Does anyone will say that seller will sell at a lower price & will take loss to sell at ebay ?
Solar Panel store Solar Panel store is also available at amazon.com. Nice Solar panel store also.
Well, I say No! Don’t know about you! You are free to comment here!
Google is the Dad of Internet. So if you search Google for eBay scam, frauds, etc you will get a bunch of results. Where people’s are just crying for their hard earned money, and can’t do much as eBay is a big Giant. In the name of protecting money, I believe they have Ebay buyer protection, Think twice again, your Claim is 90% likely to be rejected by them, as it’s just an Ad campaign, to promote eBay for more attraction.
So do Ioffer.com where it would not protect your money, as you pay to the seller directly
The real Fact of these Ebay:
This is registered in USA also listed in USA stocks, Nice but these companies operate in different corner of the world as a Pvt firm.
For example In India they are registered as Ebay India Pvt Ltd, which means all profit they got, will go to them Only. You can say other market players like shopping.indiatimes.com , shopping.rediff.com etc . They just operate like Private Ltd here. Just sucking the blood out of India & other countries. The older version of the world has just been revised, where-as Britishers used to steal all things to their country.
In the name of transaction ebay charge Listing fees,Different types of selling fees, transaction fees & lots more. Never counted
And that Ebay fools buyer’s by displaying discounted price on their page. Lets say a seller list a pen cost 100$, then as ebay will charge him certain fees, Do you people think that seller will not insert that fees in his item price ???? So finally what ???
We the buyers are fool And to that our $ is also at stake cos we paid & our claim will take months of times to process or will get rejected.
Now for seller’s part, Ebay confider’s it seller’s as a Sweating Pig, where it can hunt him, at any matter of time.
More and more frequently you hear people spewing out buzz words related to training.It only gets you one step closer to getting picked up my Barnum and Bailey as you keep your significant up....
More and more frequently you hear people spewing out buzz words related to training. You know the words I’m talking about: core, functional, blah blah blah. Of course these are important ideas to address; however, more often than not way too much time is spent on movement theory and less and less time is spent on moving weights and getting results. While proper alignment and conditioning of the body as a whole is of the utmost importance, moving serious weight is how you change your physique and put on lean powerful muscle.
It doesn’t matter if you can stand on one foot on a BOSU ball, hold a resistance tube in one hand, balance a medicine ball on the other foot, all while texting your girl friend with your free hand. What does that really accomplish? It only gets you one step closer to getting picked up my Barnum and Bailey as you keep your significant other in the loop. If your goal is to be a circus clown while communicating with your little lady electronically keep up the good work. If you are into getting stronger, more powerful, and putting on muscle you MUST set down the phone and MOVE WEIGHT. Using a home gym that allows you to do traditional lifts is a great way to accomplish this. The question then becomes, “which gym?”
There are literally tons of different lines of equipment out there. So, how do you pick equipment for your home? First and foremost you must be sure to invest in equipment that you will use. There are a few main things to consider when trying determining if you will use your choice for the months and years to come.
1. Quality of Movement – the equipment must have a ROM (Range of Motion) that is natural for your body while the strength curve matches up well with the bio-mechanics of the human physique. Buying the cheapest piece out there is often a way to get a rickety piece of “equipment” (I use the term generously because many of the pieces I see are hardly worthy of being called “equipment.) If your choice is rickety and shaky you will quickly become discouraged in its ability to handle the weight necessary to get you to your desired results. On the other end of the spectrum, some home gyms are around $10,000. Let’s be honest…for $10,000 you should be able to buy a home gym, a motorcycle, a new designer suit, and all the $5 Hot and Ready Pizzas you can eat in a year!
2. Quality of Machinery – the equipment must be made of top quality materials and components so that every time you are ready to train it is there and ready to go just like you. Nothing is more frustrating than sitting on your gym to do a press and a pulley pops off or the selectorized weight track is rubbing on the rails and it sticks with each rep. (Actually more frustrating would be when you’re at the Gym and have to wait on cell phone guy as he greases up the equipment just hanging out chatting on the lat pull down like it is his private Lazy Boy). The point here is choose a piece for your home that operates smoothly and can handle the weight you can do today and the weight you will be able to do in 1, 2 and 3 years from now. You will get stronger so be sure to make sure your gym can handle it!
3. Quality versus Cost- while there are many options available, it is often a challenge to find a brand that manages to supply high quality movement and machinery while keeping the overall cost in check. Although I don’t believe in skimping when it comes to investing in your body, there comes a point that it can be overkill. You and only you can determine what it the right amount to invest into your physique when choosing a Home Gym.
When first checking out the Powertec line I wasn’t sure what to expect. The only thing I knew about Powertec previously was that Jay Cutler was in their advertisements in Muscle and Fitness Magazine years back and the equipment was yellow. As I was shooting the 2011 Catalogue, I had a chance to really try out the machines and was pleasantly surprised. This is equipment that can handle serious weight and feels solid. The Powertec line can handle any weight I can.
Powertec has done a great job at addressing the main concerns when it comes to purchasing home equipment.
1. Quality of Movement- each piece of equipment goes through a full range of motion on numerous exercises. The movement is smooth and stable. You get the “gym quality” feel you should look for in a home unit.
2. Quality of Machinery- the Powertec design crew goes to great lengths to check and recheck each piece to be sure that what they put out with their name on it will be an accurate representation of the Powertec name.
3. Quality versus Cost- I have been workout out since 1993 and have been on nearly every brand of equipment out there at all price levels. From personal experience (buying a competitors products years ago) I can tell you that Investing, within reason, in a solid piece of equipment like those put out by Powertec is the way to go. A $100 piece of equipment will not last or get used and a $10000 is just plain over priced for a home unit. Powertec has hit the sweet spot. Great Quality at a Very Reasonable Price.
Depending on your price range and available space Powertec has a unit that is the ideal home gym for you. They offer complete gyms that allow multiple users at one time such as the Workbench Multi System. If you are dealing with a smaller space but still desire awesome capability the Workbench Levergym is a great choice. Other designs and individual pieces are available but these are two of my personal favorites for the complete Home Gym option. Pick the Home Gym that’s best for you and get started creating the physique you deserve!
It doesn’t matter if you can stand on one foot on a BOSU ball, hold a resistance tube in one hand, balance a medicine ball on the other foot, all while texting your girl friend with your free hand. What does that really accomplish? It only gets you one step closer to getting picked up my Barnum and Bailey as you keep your significant other in the loop. If your goal is to be a circus clown while communicating with your little lady electronically keep up the good work. If you are into getting stronger, more powerful, and putting on muscle you MUST set down the phone and MOVE WEIGHT. Using a home gym that allows you to do traditional lifts is a great way to accomplish this. The question then becomes, “which gym?”
There are literally tons of different lines of equipment out there. So, how do you pick equipment for your home? First and foremost you must be sure to invest in equipment that you will use. There are a few main things to consider when trying determining if you will use your choice for the months and years to come.
1. Quality of Movement – the equipment must have a ROM (Range of Motion) that is natural for your body while the strength curve matches up well with the bio-mechanics of the human physique. Buying the cheapest piece out there is often a way to get a rickety piece of “equipment” (I use the term generously because many of the pieces I see are hardly worthy of being called “equipment.) If your choice is rickety and shaky you will quickly become discouraged in its ability to handle the weight necessary to get you to your desired results. On the other end of the spectrum, some home gyms are around $10,000. Let’s be honest…for $10,000 you should be able to buy a home gym, a motorcycle, a new designer suit, and all the $5 Hot and Ready Pizzas you can eat in a year!
2. Quality of Machinery – the equipment must be made of top quality materials and components so that every time you are ready to train it is there and ready to go just like you. Nothing is more frustrating than sitting on your gym to do a press and a pulley pops off or the selectorized weight track is rubbing on the rails and it sticks with each rep. (Actually more frustrating would be when you’re at the Gym and have to wait on cell phone guy as he greases up the equipment just hanging out chatting on the lat pull down like it is his private Lazy Boy). The point here is choose a piece for your home that operates smoothly and can handle the weight you can do today and the weight you will be able to do in 1, 2 and 3 years from now. You will get stronger so be sure to make sure your gym can handle it!
3. Quality versus Cost- while there are many options available, it is often a challenge to find a brand that manages to supply high quality movement and machinery while keeping the overall cost in check. Although I don’t believe in skimping when it comes to investing in your body, there comes a point that it can be overkill. You and only you can determine what it the right amount to invest into your physique when choosing a Home Gym.
When first checking out the Powertec line I wasn’t sure what to expect. The only thing I knew about Powertec previously was that Jay Cutler was in their advertisements in Muscle and Fitness Magazine years back and the equipment was yellow. As I was shooting the 2011 Catalogue, I had a chance to really try out the machines and was pleasantly surprised. This is equipment that can handle serious weight and feels solid. The Powertec line can handle any weight I can.
Powertec has done a great job at addressing the main concerns when it comes to purchasing home equipment.
1. Quality of Movement- each piece of equipment goes through a full range of motion on numerous exercises. The movement is smooth and stable. You get the “gym quality” feel you should look for in a home unit.
2. Quality of Machinery- the Powertec design crew goes to great lengths to check and recheck each piece to be sure that what they put out with their name on it will be an accurate representation of the Powertec name.
3. Quality versus Cost- I have been workout out since 1993 and have been on nearly every brand of equipment out there at all price levels. From personal experience (buying a competitors products years ago) I can tell you that Investing, within reason, in a solid piece of equipment like those put out by Powertec is the way to go. A $100 piece of equipment will not last or get used and a $10000 is just plain over priced for a home unit. Powertec has hit the sweet spot. Great Quality at a Very Reasonable Price.
Depending on your price range and available space Powertec has a unit that is the ideal home gym for you. They offer complete gyms that allow multiple users at one time such as the Workbench Multi System. If you are dealing with a smaller space but still desire awesome capability the Workbench Levergym is a great choice. Other designs and individual pieces are available but these are two of my personal favorites for the complete Home Gym option. Pick the Home Gym that’s best for you and get started creating the physique you deserve!
(Still seller goes there )
Now, despite 4-5% transaction fees + 5%FVF (roughly) + Listings fees at lot more…..
Does anyone will say that seller will sell at a lower price & will take loss to sell at ebay ?
Solar Panel store Solar Panel store is also available at amazon.com. Nice Solar panel store also.
Well, I say No! Don’t know about you! You are free to comment here!
Subscribe to:
Posts (Atom)