1.安装jdk1.8
官网下载地址:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
选择操作系统和对应的文件进行下载
直接下载tar.gz版本,不用安装,直接解压就可以
[图片上传失败...(image-8d24a5-1560867798014)]下载完以后,解压到/usr/local目录
[root@bogon hcb]# tar zxvf jdk-8u211-linux-x64.tar.gz -C /usr/local
2.安装tomcat
官方网内打不开了。 直接通过镜像下载
https://mirrors.cnnic.cn/apache/tomcat/tomcat-8/v8.5.42/bin/
[图片上传失败...(image-f77ea-1560867798014)]
同样解压安装就可以
tar zxvf apache-tomcat-8.5.42.tar.gz -C /usr/local
- 建立一个tomcat的快捷方式
ln -s apache-tomcat-8.5.42 tomcat
- 启动:
[root@bogon tomcat]# pwd
/usr/local/tomcat
[root@bogon tomcat]# ./bin/startup.sh
3.添加防火墙例外,并重启
[root@bogon tomcat]# firewall-cmd --zone=public --add-port=8080/tcp --permanent
success
[root@bogon tomcat]# firewall-cmd --reload
4.物理机输入ip地址测试
3.安装Mysql
因为centos 7 默认源mariadb替换了mysql
所以要把mysql先添加到源上
-
下载mysql源安装包
如果 Centos 系统版本大于7,默认源使用 mariadb 替换掉了 MySQL, 如果仍要安装 MySQL,只能采取源码安装。
-
安装mysql源
yum localinstall mysql57-community-release-el7-8.noarch.rpm
-
检查mysql的源是否安装成功
yum repolist enabled | grep “mysql.-community.”
-
安装Mysql
yum install mysql-community-server
-
启动Mysql
systemctl start mysqld
-
查看默认的root密码
[root@bogon hcb]# grep 'temporary password' /var/log/mysqld.log 2019-06-18T05:11:11.189330Z 1 [Note] A temporary password is generated for root@localhost: k(VPiD:wg7lh
-
修改root密码
提示;ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
这是表示 你的新密码安全强度不够。增强密码强度就可以,注意区分大小写
[root@bogon hcb]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.26 Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'xdafdafdsaf2123231';
-
如何关闭密码策略
vi /etc/my.cnf 中最后添加 下面一行。表示 关闭密码策略 validate_password=off
-
重启mysql后生效
systemctl restart mysqld
-
mysql设定开机启动
[root@bogon hcb]# systemctl enable mysqld [root@bogon hcb]# systemctl daemon-reload
systemctl 是centos7中用于控制系统服务的。以 前版本是service xxx start|stop
daemon 是linux的守护进程 ,用于后台长期不间断运行的程序
参考:https://blog.csdn.net/yuanlaijike/article/details/78877830