ÓÉÓÚ·þÎñÆ÷apache¿¹²»×¡Ä¿Ç°µÄ²¢·¢.¼ÓÉÏÇ°¶ËsquidÅäÖúó,ÎÊÌâÒÀÈ»ÎÞ·¨½â¾ö.¶øÒ³Ãæ³ÌÐò´ó²¿·ÖÊǶ¯Ì¬.ÎÞ·¨Ê¹ÓÃfastcgiÀ´´¦Àí.Òò´ËÏë ʹÓÃnginx×öΪ·´Ïò´úÀíapache.Õû¸öÅäÖð²×°¹ý³ÌºÜ¼òµ¥.ÔÚ¿¼ÂǸ߲¢·¢µÄÇé¿öÏÂ,ÔÚ°²×°Ç°¾Í×öÁËЩÓÅ»¯.Ä¿Ç°ÅäÖÃÄÜ¿¹×¡3000ÒÔÉϲ¢·¢.ºÃÏñ ²»ÊÇÌرð´óŶ?ºÇ~~ µ«×ãÒÔ~~ Ö»ÊÇ»¹ÓÐÉÙÁ¿499ÎÊÌâ..ÆÚ´ýÓÐÈ˸úÎÒÌÖÂÛ½â¾ö£»
µÚ1²¿·Ö:°²×°
1 ½¨Á¢Óû§¼°×é
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
2 °²×°pcre ÈÃnginxÖ§³Örewrite ·½±ãÒÔºóËùÐè
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.8.tar.gz
tar zxvf pcre-7.8.tar.gz
cd pcre-7.8/
./configure
make && make install
3 °²×°nginx
wget http://sysoev.ru/nginx/nginx-0.7.58.tar.gz
tar zxvf nginx-0.7.58.tar.gz
cd nginx-0.7.58/
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-cc-opt='-O2' --with-cpu-opt=opteron
make && make install
#
×¢ÒâÉÏÎÄÖеÄ--with-cc-opt='-O2' --with-cpu-opt=opteron ÕâÊDZàÒëÆ÷ÓÅ»¯,Ä¿Ç°×î³£ÓõÄÊÇ-02
¶ø²»ÊÇ3.ºóÃæ¶ÔÓ¦CPUµÄÐͺÅ,¿É²ÎÕÕ:http://wiki.gentoo.tw/index.php/HOWTO_CFLAG
µÚ2²¿·Ö:ÅäÖü°ÓÅ»¯ÅäÖÃÎļþ
1 nginx.conf ÅäÖÃÎļþ:
user www www;
worker_processes 4;
# [ debug | info | notice | warn | error | crit ]
error_log /usr/local/webserver/nginx/logs/nginx_error.log crit;
pid /usr/local/webserver/nginx/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
}
http
{
include mime.types;
default_type application/octet-stream;
source_charset GB2312;
server_names_hash_bucket_size 256;
client_header_buffer_size 256k;
large_client_header_buffers 4 256k;
#size limits
client_max_body_size 50m;
client_body_buffer_size 256k;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
#²ÎÊý¶¼ÓÐËùµ÷Õû.Ä¿µÄÊǽâ¾ö´úÀí¹ý³ÌÖгöÏÖµÄһЩ502 499´íÎó
sendfile on;
tcp_nopush on;
keepalive_timeout 120; #²ÎÊý¼Ó´ó,ÒÔ½â¾ö×ö´úÀíʱ502´íÎó
tcp_nodelay on;
include vhosts/upstream.conf;
include vhosts/bbs.linuxtone.conf;
}
2 upstream.conf ÅäÖÃÎļþ(ÕâÒ²ÊÇ×ö¸ºÔصÄÅäÖ÷½·¨)
upstream.conf
upstream bbs.linuxtone.com {
server 192.168.1.4:8099;
}
3 Õ¾µãÅäÖÃÎļþ
bbs.linuxtone.conf
server
{
listen 80;
server_name bbs.linuxtone.conf;
charset GB2312;
index index.html index.htm;
root /date/wwwroot/linuxtone/;
location ~ ^/NginxStatus/ {
stub_status on;
access_log off;
}
location / {
root /date/wwwroot/linuxtone/;
proxy_redirect off ;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 50m;
client_body_buffer_size 256k;
proxy_connect_timeout 30;
proxy_send_timeout 30;
proxy_read_timeout 60;
proxy_buffer_size 256k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_max_temp_file_size 128m;
proxy_pass http://bbs.linuxtone.com;
}
#²ÎÊý¶¼ÓÐËùµ÷Õû.Ä¿µÄÊǽâ¾ö´úÀí¹ý³ÌÖгöÏÖµÄһЩ502 499´íÎó
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ