tomcat+memcache+nginx

   1.安裝jdkphp

    tar zxf jdk-7u79-linux-x64.tar.gz -C /usr/local/ java

    cd /usr/local/ linux

    ln -s jdk1.7.0_79/ java
nginx

wKiom1l0E5aBCqACAACwyU-PC8g411.png

    vim /etc/profile
apache

wKioL1l0E7Dxp8RjAABME2ft0I8503.png

    source /etc/profilevim

 

   測試tomcat

wKiom1l0E_iDGAd2AAAh_8HhKTg179.png


   2.安裝TOMCAT
    tar zxf apache-tomcat-7.0.37.tar.gz -C /usr/local/
    cd /usr/local/
    ln -s apache-tomcat-7.0.37/ tomcat
    cd /usr/local/tomcat/bin
    ./startup.sh 
session

wKiom1l0FGLhkEj8AACHWH_g0HU587.png

    測試ide

wKiom1l0FT3wB9OVAABBLHl71ds805.png


   3.TOMCAT+NGINXmemcached

    vim /usr/local/lnmp/nginx/conf/nginx.conf

wKioL1l0Fj-gT44FAAAxXN2K5r0157.png

wKiom1l0FlDg_7j0AAAYzXZgujM394.png

    nginx -s reload
    /etc/init.d/php-fpm start 

 


  測試

wKioL1l0FrqAg7oMAABRied5GcQ599.png

wKiom1l0FruxqxEJAAA_pWecICs980.png


4.  <T1>     <T2>   tomcat 和memcache 兩臺虛擬機作相同操做
        .   \    /  .    
        .     X    .
        .   /    \  .
    <M1>    <M2>   
  

  *  yum install memcached
     /etc/init.d/memcached start 

wKiom1l0HGGDzCF8AAAU_rbRN_0682.png

wKioL1l0HJKQAT-bAABDqRJdqqc078.png

     rm -fr memcached-session-manager-tc6-1.6.3.jar  

wKioL1l0HK6Seh6oAAAyRuNtDWg324.png

  *  vim /usr/local/tomcat/conf/context.xml      ##另外一臺主機failoverNodes 改成n2

wKiom1l0HO2RNLnQAAC3x3bTg4g569.png 

  *  cd /usr/local/tomcat/bin/     ##重啓Tomcat
     ./shutdown.sh
     ./startup.sh  


測試
    tail -f logs/catalina.out


wKioL1l0HZqDm94rAAD3SDH9DiE844.pngwKiom1l0Hb3jFa0BAACpDBUo0t8320.png


  5.Sticky
  *  tar -zxf nginx-goodies-nginx-sticky-module-ng-c78b7dd79d0d.tar.gz
     ./configure --prefix=/opt/nginx --user=nginx --group=nginx   --with-threads  --with-file-aio   --with-http_ssl_module   --with-http_stub_status_module --add-module=/root/nginx-goodies-nginx-sticky-module-ng-c78b7dd79d0d.tar.gz  
  833  ./configure --prefix=/opt/nginx --user=nginx --group=nginx   --with-threads  --with-file-aio   --with-http_ssl_module   --with-http_stub_status_module --add-module=/root/nginx-goodies-nginx-sticky-module-ng-c78b7dd79d0d
     make
     make install       ##安裝nginx和sticky模塊

wKiom1l0Ho2Tj77CAACUyiHIeR8513.png
   *  vim /opt/nginx/conf/nginx.conf

wKioL1l0HryiV1W4AAAjQipIcKM632.png

wKioL1l0HszThGV9AAAo5uskuSk955.png

       *  ./nginx start


測試

wKiom1l0HyKzefLGAACYcSS-rRs106.png

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息