一、jdk配置
1.下载jdk安装包 传送门 (我使用的是 Tomcat:1.8.0_121)
2.将下载后的jdk传到服务器上
[root@localhost ~]# cd /usr/
[root@localhost usr]# mkdir java
[root@localhost usr]# cd java/
[root@localhost java]# mkdir jdk
[root@localhost java]# cd jdk
[root@localhost jdk]#
#set java environment
export JAVA_HOME=/usr/java/jdk/jdk1.8.0_144
export JRE_HOME=/usr/java/jdk/jdk1.8.0_144/jre
export CLASSPATH=.:$JAVA_HOME/lib$:JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin/$JAVA_HOME:$PATH
[root@localhost mnt]#
[root@localhost ~]# java -version
如果出现java的版本号,则证明安装成功
二、tomcat配置
1.下载tomca安装包 传送门
2.将下载好的安装包上传到服务器上
3.找到文件所在目录
# tar -xvf apache-tomcat-8.5.16.tar.gz -C /usr/java/tomcat/
export JAVA_HOME=/usr/java/jdk/jdk1.8.0_141
export JRE_HOME=/usr/java/jdk/jdk1.8.0_141/jre
[root@localhost apache-tomcat-8.5.11]# cd webapps/
rpm-qa| grep mysql#由下至上依次卸载
rpm-qa| grep mariadb
rpm-e xxx#一般使用此命令即可卸载成功
rpm-e--nodeps xxx#卸载不成功时使用此命令强制卸载
yum install-y libaio-*
mkdir-p/usr/local/mysql
cd/usr/local/src
wget http://zy-res.oss-cn-hangzhou.aliyuncs.com/mysql/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
tar-xzvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.7.17-linux-glibc2.5-x86_64/* /usr/local/mysql/
groupadd mysql
useradd-g mysql-s/sbin/nologin mysql
/usr/local/mysql/bin/mysqld--initialize-insecure--datadir=/usr/local/mysql/data/--user=mysql
chown-R mysql:mysql/usr/local/mysql
chown-R mysql:mysql/usr/local/mysql/data/
chown-R mysql:mysql/usr/local/mysql
cd/usr/local/mysql/support-files/
cp mysql.server/etc/init.d/mysqld
chmod+x/etc/init.d/mysqld
vim/etc/rc.d/rc.local
vi/root/.bash_profile
PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib
source/root/.bash_profile
/etc/init.d/mysqld start
mysqladmin -u root password "xxxx"
mysql -uroot -p密码 #-p和密码之间无空格