yum install java-1.8.0-openjdk 安装jdk
yum install tomcat 安装tomcat
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpmyum install mysql-server 安装mysql重置密码重置密码前,首先要登录$ mysql -u root登录时有可能报这样的错:ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2),原因是/var/lib/mysql的访问权限问题。下面的命令把/var/lib/mysql的拥有者改为当前用户:$ sudo chown -R openscanner:openscanner /var/lib/mysql然后,重启服务:$ service mysqld restart接下来登录重置密码:$ mysql -u rootmysql > use mysql;mysql > update user set password=password(‘123456‘) where user=‘root‘;mysql > exit;
systemctl status tomcat.service 查看tomcat是否死亡状态,如果死亡状态进行下一步
systemctl start tomcat.service 跑tomcat
systemctl stop tomcat.service 停止
systemctl restart tomcat.service重启
systemctl enable tomcat 设置开机启动
systemctl stop firewalld.service 关闭防火墙
如果usr/share/tomcat/apps里面为空,输入yum install tomcat-webapps tomcat-admin-webapps
下载 mysql-connector-java
下载地址:https://mvnrepository.com/artifact/mysql/mysql-connector-java以为例:mysql-connector-java-5.1.25.tar.gz为例:将mysql-connector-java-5.1.25.tar.gz解压并放在/usr/local/下:cd mysql-connector-java-5.1.25cp mysql-connector-java-5.1.25-bin.jar /usr/local/tomcat/lib
重启tomcat
cd /usr/local/tomcat/bin./shutdown.sh./startup.sh