1.安装jdk
tar zxf jdk-7u79-linux-x64.tar.gz -C /usr/local/
cd /usr/local/
ln -s jdk1.7.0_79/ java
https://s1.运维网.com/wyfs02/M02/9C/A6/wKiom1l0E5aBCqACAACwyU-PC8g411.png
vim /etc/profile
https://s5.运维网.com/wyfs02/M02/9C/A6/wKioL1l0E7Dxp8RjAABME2ft0I8503.png
source /etc/profile
测试
https://s4.运维网.com/wyfs02/M00/9C/A6/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
https://s2.运维网.com/wyfs02/M00/9C/A6/wKiom1l0FGLhkEj8AACHWH_g0HU587.png
测试
https://s5.运维网.com/wyfs02/M01/9C/A6/wKiom1l0FT3wB9OVAABBLHl71ds805.png
3.TOMCAT+NGINX
vim /usr/local/lnmp/nginx/conf/nginx.conf
https://s4.运维网.com/wyfs02/M00/9C/A6/wKioL1l0Fj-gT44FAAAxXN2K5r0157.png
https://s1.运维网.com/wyfs02/M02/9C/A6/wKiom1l0FlDg_7j0AAAYzXZgujM394.png
nginx -s reload
/etc/init.d/php-fpm start
测试
4. tomcat 和memcache 两台虚拟机做相同操作
. \ / .
. X .
. / \ .
* 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
https://s1.运维网.com/wyfs02/M02/9C/A7/wKioL1l0HZqDm94rAAD3SDH9DiE844.pnghttps://s5.运维网.com/wyfs02/M00/9C/A7/wKiom1l0Hb3jFa0BAACpDBUo0t8320.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模块
* ./nginx start
测试
|