*JDK(java)版本必须和tomcat版本保持一致、jdk和tomact版本不需要编译安装

1、安装JDK

tar -zxvf jdk

配置jdk环境变量:

[root@BJ-NQ-V-36230 local]# vim /etc/profile

export JAVA_HOME=/usr/local/jdk

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=$JAVA_HOME/lib

 CATALINA_HOME=/usr/local/tomcat/


"/etc/profile" 83L, 1977C                                                                                                                                                                                                  82,2          95%

export CLASSPATH=$JAVA_HOME/lib

 CATALINA_HOME=/usr/local/tomcat/

 PATH=$JAVA_HOME/bin:/usr/local/tomcat/bin/:$PATH

重载环境变量:

[root@BJ-NQ-V-36230 local]# source /etc/profile


启用tomcat

[root@BJ-NQ-V-36230 bin]# pwd

/usr/local/tomact/bin

[root@BJ-NQ-V-36230 bin]# sh startup.sh


修改tomcat 默认页面增加新的jsp页面

[root@BJ-NQ-V-36230 ROOT]# pwd

/usr/local/tomact/webapps/ROOT


启用nginx

[root@BJ-NQ-V-36230 ~]# /etc/init.d/nginx start

[root@BJ-YZ-V-web ~]# /usr/local/nginx/sbin/nginx 

重载nginx

[root@BJ-NQ-V-36230 sbin]# ./nginx  -s reload 

进nginx配置信息修改配置文件:

[root@BJ-NQ-V-36230 nginx]# vim conf/nginx.conf 

 location / {

            root  html;

          index index.jsp;

        proxy_pass http://192.168.36.230:8080;

        }


http://192.168.36.230/



清除 tomcat缓存:

[root@BJ-NQ-V-36230 tomcat]# rm -rf work/Catalina/localhost/