1、系统环境
CentOS6.5
2、下载JDK,tomcat软件包,官网可以下载,也可以用命令行下载
Mysql使用yum安装
3、linux安装JDK
1)下载JDK
2)下载后发现名字有点长,修改一下
#mv jdk-8u45-linux-x64.tar.gz\?AuthParam\=1434620688_1831ed06c98894056108fddcb5c59167 jdk-8u45-linux-x64.tar.gz
3)解压到/usr/local/
#tar -zxvf jdk-8u45-linux-x64.tar.gz -C /usr/local/
4)设置JAVA环境变量
打开/etc/profile添加
#vim /etc/profile
#set java environment
JAVA_HOME=/usr/local/jdk1.8.0_45
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
5)验证,输入java
#java
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server,
because you are running on a server-class machine.
4、安装Tomcat
1)下载tomcat
#wget http://apache.fayea.com/tomcat/tomcat-6/v6.0.44/bin/apache-tomcat-6.0.44.tar.gz
2)解压
#tar -zxvf apache-tomcat-6.0.44.tar.gz -C /usr/local/
3)启动tomcat
# cd apache-tomcat-6.0.44/
#./startup.sh
4)访问tomcat