前往顾页
以后地位: 主页 > 收集编程 > Jsp实例教程 >

JSP环境搭建 centos Tomcat 9

时候:2018-08-20 23:04来源:知行网www.zhixing123.cn 编辑:麦田守望者

软件包下载地点:

  • JRE
  • Tomcat

JAVA环境装置

 
yum -y update # 进级体系
cd /usr/local
wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=111741 -O jre.tar.gz
tar zxvf jre.tar.gz
chown root:root jre1.8.0_66 # 默许的权限貌似不一样

echo "export JAVA_HOME=/usr/local/jre1.8.0_66" >> /etc/profile # 写入JAVA_HOME
echo "export CLASSPATH=.:%JAVA_HOME%/lib/dt.jar:%JAVA_HOME%/lib/tools.jar" >> /etc/profile # 写入JAVA_CLASSPATH
source /etc/profile # 当即见效
env |grep JAVA # 检察是不是见效
#JAVA_HOME=/usr/local/jre1.8.0_66
#CLASSPATH=.:%JAVA_HOME%/lib/dt.jar:%JAVA_HOME%/lib/tools.jar

ln -s /usr/local/jre1.8.0_66/bin/java /sbin/java # 建立法度疾速体例,不然会提示找不到法度

java -version
#java version "1.8.0_66"
#Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
#Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) 

 

Tomcat 装置

 
# 生产环境最好还是Tomcat 7适合!
wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-9/v9.0.0.M1/bin/apache-tomcat-9.0.0.M1.tar.gz
tar zxvf apache-tomcat-9.0.0.M1.tar.gz
mv apache-tomcat-9.0.0.M1 tomcat
/usr/local/tomcat/bin/startup.sh #启动办事器
#Using CATALINA_BASE: /usr/local/tomcat
#Using CATALINA_HOME: /usr/local/tomcat
#Using CATALINA_TMPDIR: /usr/local/tomcat/temp
#Using JRE_HOME: /usr/local/jre1.8.0_66
#Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
#Tomcat started.
/usr/local/tomcat/bin/shutdown.sh # 封闭办事器 

 

war包摆设

打包项目为web.war文件,安排tomcat目次的webapps下!重启tomcat便可。拜候地点为localhost/web (包的名字)
war

开机启动

vi /etc/rs.local
/usr/local/tomcat/bin/startup.sh

------分开线----------------------------
标签(Tag):JSP环境搭建
------分开线----------------------------
保举内容
猜你感兴趣