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
vim /etc/profile
apache
source /etc/profilevim
測試tomcat
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
測試ide
3.TOMCAT+NGINXmemcached
vim /usr/local/lnmp/nginx/conf/nginx.conf
nginx -s reload
/etc/init.d/php-fpm start
測試
4. <T1> <T2> tomcat 和memcache 兩臺虛擬機作相同操做
. \ / .
. X .
. / \ .
<M1> <M2>
* yum install memcached
/etc/init.d/memcached start
rm -fr memcached-session-manager-tc6-1.6.3.jar
* vim /usr/local/tomcat/conf/context.xml ##另外一臺主機failoverNodes 改成n2
* cd /usr/local/tomcat/bin/ ##重啓Tomcat
./shutdown.sh
./startup.sh
測試
tail -f logs/catalina.out
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模塊
* vim /opt/nginx/conf/nginx.conf
* ./nginx start
測試