nginxÅäºÏtomcat¡¢resinµÈjavaÓ¦Ó÷þÎñÆ÷ÌṩjavaÖ§³Ö
Ê×ÏÈ̽ÌÖÒ»ÏÂΪʲôҪʹÓÃnginx£º
1¡¢ÀàËÆÓÚapache+resin£¬nginxÓÃÓÚÌṩ¾²Ì¬Ò³Ãæ·þÎñ£¬±Èjava·þÎñÆ÷Ҫǿ¡£ËäÈ»ÕâЩjava·þÎñÆ÷µÄÐÔÄܶ¼²»Àµ£¬tomcatаæÉõÖÁ»¹Ö§³ÖÁËepoll£¬µ«ÊÇÓÃnginxÀ´´¦Àí¾²Ì¬ÎļþÊÇÒ»¶¨±ÈÕâЩ·þÎñÆ÷¸üÎÈÍײ¢¸ü¿ìËٵġ£
2¡¢nginxÔÚÅäºÏjavaÓ¦Ó÷þÎñÆ÷ʱÏà±ÈapacheñîºÏ¶È¸üµÍ£¬ËùÒÔËü¿ÉÒÔÓÃÏàͬµÄ·½Ê½Á¬ÉÏËùÓÐÄÜÖ§³Öhttp·þÎñÄÜÁ¦µÄjavaÓ¦Ó÷þÎñÆ÷£¬ÎÞÂÛÊÇtomcat¡¢resin¡¢weblogic¡¢jetty¡¢websphere……£¬²¢ÇÒ¿ÉÒÔÇáÒ׵ؽ«Ò»¸öÓ¦ÓÃͬʱÁ¬½Ó²»ÏàͬµÄ·þÎñÆ÷¡£Æ©Èçһ̨ÅÜtomcat£¬Ò»Ì¨ÅÜresin£¬ÕâÒ»µãÔÚÇл»»ò²âÊÔÉú²ú»·¾³Ê±·Ç³£ÓÐÓá£ÁíÍâñîºÏ¶ÈµÄ½µµÍ£¬½«Ê¹nginxºÍÕâЩ·þÎñÆ÷Ö®¼äµÄÏ໥ӰÏì½µµ½×îµÍ£¬ÕâÑùÁ½Õß¾ÍÄܸ÷¾¡ÆäÔð£¬apacheÒ»°ãÊDzÉÓÃÒ»¸öÄ£¿éÀ´ºÍjavaÓ¦Ó÷þÎñÆ÷´ò½»µÀ£¬Õâ¸öÄ£¿éÊÇ»á¶ÔapacheµÄÔËÐлò¶à»òÉÙ²úÉúÓ°ÏìµÄ£¬nginx¸æËßÎÒÃÇÕâЩģ¿éÊǶàôµÄ¼¦Àߣ¬java·þÎñÆ÷Òª²»¾ÍÍùfastcgiÐÒéÖ§³Ö·½Ãæ·¢Õ¹»á¸üºÃ¡£
3¡¢nginxµÄÒ»Ð©ÌØÐÔ¿ÉÒÔ±£×¡´àÈõµÄjava·þÎñÆ÷¡£ÆäÖпÉÒÔµãÃûµÄ£º1ÊÇ¿ÉϸÖ¶¨ÖƵĸºÔؾùºâ²ßÂÔ£»2Êdz¬Ç¿µÄ¹ÊÕÏÆÁ±Î¹¦ÄÜ¿ÉÒÔ×öµ½²»ÒÅ©ÈκÎÒ»¸öÇëÇó£»3Êǿͻ§¶ËÁ¬½ÓµÄÒì²½´¦Àí£»4ÊDZÈjava·þÎñÆ÷Ç¿Éϰٱ¶µÄ¸ººÉÄÜÁ¦¡£
×ÛºÏÕâЩÓŵ㣬һ°ãµÄjavaÓ¦Ó÷þÎñÆ÷£¬½ÓÉÏÒ»¸önginxºó£¬ÔÚ·þÎñÎȶ¨ÐÔÉϽ«¿ÉÆ¥µÐÊýÍòÃÀ½ðµÄ´óÐÍjava¼¯Èº·þÎñÆ÷£¬java¿ª·¢Õ߾Ͳ»ÓÃÔÙΪjavaÐÔÄÜ·½Ãæ·¢³îÁË¡£
Èç¹û¾ö¶¨ÊÔÓÃÒ»ÏÂnginx£¬ÄǽÓÏÂÀ´µÄʾͱÈÍ¿ÚË®ÇáËɵöàÁË¡£
nginx¿ÉÒÔÓÃÁ½ÖÖ·½Ê½È¥½Ójavaºǫ́£º
1¡¢½«jspÀ©Õ¹ÃûµÄÇëÇó·¢Íùºǫ́£¬ÕâÊDZȽϴ«Í³µÄ·½Ê½
2¡¢½«ËùÓÐÇëÇó¶¼·¢Íùºǫ́£¬¶ø½«Ò»Ð©¾²Ì¬ÎļþµÄĿ¼ÁôÏÂ
3¡¢½«ËùÓÐÇëÇó¶¼·¢Íùºǫ́£¬¶ø½«Ä³ÖÖÀ©Õ¹ÃûµÄÁ´½ÓÁôÏÂ
ÕâÈýÖÖ·½Ê½¶¼ÊÇÀûÓÃÁ´½ÓÌØÕ÷´¦ÀíµÄ£¬¾ÙÀý˵Ã÷£¨Àý×ÓÖÐÊÇ·þÎñÆ÷Êǵ¥»ú£©£º
Ê×ÏÈÅäÖÃÒ»¸öupstream£¬ÕâÊÇͨÓõģº
upstream www.sudone.com {
server 127.0.0.1:8081;
server 127.0.0.1:8082;
}
127.0.0.1:8081ºÍ127.0.0.1:8082¾ÍÊǺó¶Ë·þÎñÆ÷ÁË£¬resinÖ§³ÖÁ½ÖÖ·½Ê½·þÎñ£¬Ò»ÖÖÊÇÒýÇæ·½Ê½ÓÃÓÚÁ¬½ÓapacheºÍIIS£¬ÁíÒ»ÖÖÊÇhttp server·½Ê½£¬Ò»¶¨ÒªÆô¶¯µÄÊÇhttp·þÎñÆ÷·½Ê½µÄ£¬ÕâÑùÕâÁ½¸ö¶Ë¿Ú²ÅÓÐЧ¡£tomcatÎÒ²»Ì«Çå³þ£¬Èç¹ûÓÐÁ½ÖÖ·½Ê½£¬Ò²Ò»¶¨ÒªÆô¶¯http server·½Ê½£¬¼ì²éµÄ°ì·¨ÊÇͨ¹ýÒ»¸öÁ´½ÓÒªÄܹ»Ö±½Ó·ÃÎʵõ½Ò³Ãæ¡£
Õë¶ÔÀ©Õ¹ÃûµÄ²ßÂÔµÄÅäÖãº
server {
listen 80;
server_name www.sudone.com;
location / {
root /data/html/;
rewrite "^/([0-9]+)\.
Ïà¹ØÎĵµ£º
LuceneÊÇÒ»¸ö»ùÓÚJavaµÄÈ«ÎÄË÷Òý¹¤¾ß°ü¡£
»ùÓÚJavaµÄÈ«ÎÄË÷ÒýÒýÇæLucene¼ò½é£º¹ØÓÚ×÷ÕߺÍLuceneµÄÀúÊ·
È«ÎļìË÷µÄʵÏÖ£ºLueneÈ«ÎÄË÷ÒýºÍÊý¾Ý¿âË÷ÒýµÄ±È½Ï
ÖÐÎÄÇзִʻúÖÆ¼ò½é£º»ùÓÚ´Ê¿âºÍ×Ô¶¯ÇзִÊËã·¨µÄ±È½Ï
¾ßÌåµÄ°²×°ºÍʹÓüò½é£ºÏµÍ³½á¹¹½éÉܺÍÑÝʾ
Hacking Lucene£º¼ò»¯µÄ²éѯ·ÖÎöÆ÷£¬É¾³ýµÄʵÏÖ£¬¶¨ÖƵÄÅ ......
Java "ÓÐÀíÓÉ" ±È C++ ¿ì
×î½üÉÏCSDN±È½Ï¶à£¬ÓÖ¿´µ½ËµJava±ÈC++¸ü¿ìµÄÌû×Ó¡£
JavaÔÚijЩÇé¿öϱÈC++¿ìÎÒÈÏΪÊǺÜÓеÀÀíµÄ¡£ÀýÈç¿ÉÒÔ¸ù¾ÝÌØ¶¨µÄCPU½øÐÐÓÅ»¯µÈµÈ¡£
ÓÐλ½Ð wingfiring(±ð¶ºÁË)(·ÇµäÐÍͺ×Ó) µÄÀÏÐÖ·¢ÁËÒ»¸öÌû×Ó£¬ÔÎÄÈçÏ£º
ºÃ£¬ÎÒûÄÇô¶àʱ¼ä³³C++ºÃ»¹ÊÇJavaºÃ£¬ËùÒÔ£¬ÎÒ¾ÍÏÈÕ°ÑöÒ»ÏÂÂ¥Ö÷¸ø³öµÄÁ ......
Java±à³Ì£¬Äܹ»¸ßÊÖËÙ³ÉÂð£¿ÎÒ¾õµÄÊÇ¿ÉÒԵġ£JavaµÄ֪ʶµã±È½Ï¶à£¬»òÕß˵£¬·Ç³£¶à£»µ«×ÐϸÊáÀíÒ»±é£¬ÎÒÃǻᷢÏÖһЩ¹æÂÉ¡£Í¨¹ýÕâЩ¹æÂÉ¿ÉÒÔ·ÖÎö£¬ÄÄЩJava֪ʶÊÇÐèÒªÉîÈëÍÚ¾òµÄ£¬ÄÄЩÊÇ¿ÉÒÔdz³¢éüÖ¹µÄ¡£
¡¶Java±à³Ì˼Ïë¡·£¬ ......
ÕâÊÇÎÒ¸öÈ˵ÄÀí½â£¬¼ÓÉÏÒÔǰ¿´µÄһЩÌû×Ó£¬Óв»¶ÔµÄµØ·½£¬Çë¸ßÈËÖ¸µã¡£
1.×÷Ϊjava²ÎÊý´«µÝ¸øÒ»¸öº¯ÊýµÄ¶ÔÏ󣬳ýÁ˺ܼòµ¥µÄÈçint»òÕßbooleanµÈ¼òµ¥µÄÒÔÍ⣬´«µÝµÄ¶¼ÊÇÕâ¸ö¶ÔÏóµÄÒýÓá£
µ±ÔÚ½ÓÊÕº¯ÊýÖиıäÕâ¸ö¶ÔÏóµÄʱºò£¬ÔÀ´µÄ¶ÔÏó¼´±»¸Ä±ä¡£
2.ÔÚ³õʼ»¯Ò»¸ö¶ÔÏóµÄʱºò£¬ÓÐʱºòÎÒÃÇÏ£ÍûÓÃÒ»¸öÒѾ´æÔڵĶÔÏóÀ´¸øÁíÍâÒ» ......