一、安装MySql
安装MySql
1yum install -y mysql-server mysql mysql-devel启动MySql服务
1service mysqld start为root账号设置密码
1/usr/bin/mysqladmin -u root password 'your password'
二、安装Java(这里安装的8)
下载JDK
1wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-i586.rpm"
安装JDK
1rpm -ivh jdk-8u102-linux-i586.rpm
设置环境变量
编辑java.sh文件
1vim /etc/profile.d/java.sh添加如下内容
12345#!/bin/bashJAVA_HOME=/usr/java/jdk1.8.0_102/PATH=$JAVA_HOME/bin:$PATHexport PATH JAVA_HOMEexport CLASSPATH=.保存并退出,执行下面两个命令,搞定
12chmod +x /etc/profile.d/java.shsource /etc/profile.d/java.sh
三、安装Tomcat(这里安装的9)
下载Tomcat
1wget http://archive.apache.org/dist/tomcat/tomcat-9/v9.0.0.M17/bin/apache-tomcat-9.0.0.M17.tar.gz
> 传送门:[tomcat官网](http://tomcat.apache.org/ "tomcat官网")
解压文件
1tar -zxvf apache-tomcat-9.0.0.M17.tar.gz
- 将解压后的目录复制到usr/local/下并命名为tomcat9
1
cp -R apache-tomcat-9.0.0.M17 /usr/local/tomcat9
进入bin目录
1cd /usr/local/tomcat9/bin启动tomcat
1./startup.sh
启动效果
123456Using CATALINA_BASE: /usr/local/tomcat9Using CATALINA_HOME: /usr/local/tomcat9Using CATALINA_TMPDIR: /usr/local/tomcat9/tempUsing JRE_HOME: /usr/java/jdk1.8.0_102/Using CLASSPATH: /usr/local/tomcat9/bin/bootstrap.jar:/usr/local/tomcat9/bin/tomcat-juli.jarTomcat started.关闭tomcat
1./shutdown.sh