centos安装环境软件
一/安装idk
1. rpm -qa | grep java 查询内置到jdk
2. rpm -e —nodes jdk相关名称
3. 到官网下载jdk.rpm
4. 通过winscp上传idk到centos
5. rpm -ivh idk 安装idk包
6. java -version 查看idk是否安装成功
7. vi /etc/profile 添加JAVA_HOME和更新PATH
8. export JAVA_HOME=/usr/java/default
9. export PATH=$PATH:$JAVA_HOME/bin
10. source /etc/profile 重新加载环境变量
二/安装tomcat
1. 到tomcat官网下载tomcat.tar.gz
2. winscp 拷贝压缩包到centos
3. tar -zxvf tomcat.tar.gz /usr/local/
4. cd /usr/local
5. mv tomcat_XX tomcat
6. cd tomcat/bin
7. ./startup.sh
8. netstat -ntl 查看8080是否启动监听(yum install net-tools)
9. ./shutdown.sh
三/安装mysql
1. yum list installed | grep 查看是否自带mysql
2. yum -y remove mysql-* 删除mysql相关的包
3. yum install wget
4. 到mysql官网查看yum的repository,获取最新的rpm地址
5. wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
6. rpm -Uvh mysql57-community-release-el7-11.noarch.rpm
7. yum list | grep mysql
8. yum install mysql-commnutiy-server
9. grep “password” /var/log/mysqld.log 查看临时密码
10. mysql -u root -p临时密码 #登陆
11. SET PASSWORD = PASSOWRD(“xxx”); #设置密码
root远程访问设置方法一:
1. GRANT ALL PRIVILEGES ON *.* TO ‘root@%’ IDENTIFIED BY ‘密码’ WITH GRANT OPTION;
2. flush privileges;
root远程访问设置方法二:
1. use mysql;
2. UPDATE user SET host = ‘%’ where user = ‘root’;
3. flush privileges;
四/mysql配置
1. lower_case_table_name=1 #表名称大小写不敏感
2. skip-name-resolve #阻止mysql对ip进行反向查找
五/centos防火墙
systemctl stop firewalld.service
systemctl start firewalld.service
systemctl disable firewalls.service
六、selinux
[root@dev-server ~]# getenforce
[root@dev-server ~]# /usr/sbin/sestatus -v
setenforce 0 临时关闭
vi /etc/selinux/config 永久关闭
将SELINUX=enforcing改为SELINUX=disabled
网友评论