centos 部署应用环境
① 初始化Centos
curl -O https://pigx.vip/os7init.sh sh os7init.sh pig4cloud
② 安装JDK
yum install -y java java -version
③ 安装 MYSQL
点击下载 Mysql rpm 安装包 mysql80-community-release-el7-7.noarch.rpm.zip
rpm -ivh mysql80-community-release-el7-7.noarch.rpm yum install -y mysql mysql-server # 修改配置文件 vim /etc/my.cnf lower_case_table_names=1 # 重启mysql systemctl restart mysqld # 查看默认密码 grep password /var/log/mysqld.log # mysql client 链接 mysql alter user 'root'@'localhost' identified by 'ZxcRoot123!@#'; set global validate_password.check_user_name=0; set global validate_password.policy=0; set global validate_password.length=1; alter user 'root'@'localhost' identified by 'root'; # 修改为允许远程访问 use mysql; update user set host = '%' where user = 'root'; FLUSH PRIVILEGES;
④ 安装 Redis
yum install redis systemctl restart redis
⑤ 安装 Nginx
vim /etc/yum.repos.d/nginx.repo [nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true [nginx-mainline] name=nginx mainline repo baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/ gpgcheck=1 enabled=0 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true
yum install -y yum-utils yum-config-manager --enable nginx-mainline yum install -y nginx