一:重装系统
我这里选择的是CentOS7.2
1.设置JDK环境
2.更换使用配置163源
首先备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
cd /etc/yum.repos.d/
下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
运行以下命令生成缓存
yum clean all
yum makecache
3.安装Mysql数据库
CentOS7默认安装mariadb数据库:yum remove mariadb-libs.x86_64
下载Mysql源:https://dev.mysql.com/downloads/repo/yum/
https://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
安装源:yum localinstall mysql57-community-release-el7-8.noarch.rpm
安装MySQL:yum install mysql-community-server
启动:sudo service mysqld start
默认密码:cat /var/log/mysqld.log | grep “password”
mysql -uroot -p
修改Root密码(整个复杂的)
alter user 'root'@'localhost' identified by 'P@ssw0rd';
flush privileges;
设置远程登录
grant all privileges on *.* to 'root'@'%' identified by 'P@ssw0rd' with grant option;
flush privileges;
Mysql utf8mb4字符集的处理
[root@qizi ~]# find / -name my.cnf
/etc/my.cnf
[root@qizi ~]# vim /etc/my.cnf
[root@qizi ~]#
同时数据库配置文件my.cnf 进行相应的修改
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
service mysqld restart
================安装redis===========================
关闭防火墙:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
配置编译环境:
sudo yum install gcc-c++
下载源码:
wget http://download.redis.io/releases/redis-3.2.8.tar.gz
解压源码:
tar -zxvf redis-3.2.8.tar.gz
进入到解压目录:
cd redis-3.2.8
执行make编译Redis:
make MALLOC=libc
注意:make命令执行完成编译后,会在src目录下生成6个可执行文件,分别是redis-server、redis-cli、redis-benchmark、redis-check-aof、redis-check-rdb、redis-sentinel。
安装Redis:
make install
修改配置文件
cd redis-3.2.8
vim redis.conf
redis.conf 的配置信息
1、daemonize 如果需要在后台运行,把该项改为yes
2、bind 绑定ip,设置后只接受来自该ip的请求 0.0.0.0
3、requirepass 设置 登陆时需要使用密码 123456
然后保存,重启服务
cd /usr/local/bin
./redis-server redis解压目录/redis.conf
frpc
!/bin/sh
检测FRPC代理进程是否运行的脚本
ps -fe | grep frpc.ini | grep -v grep
if [ $? -ne 0 ]
then
cd /usr/local/src/frp_0.21.0_linux_amd64
./frpc -c frpc.ini
else
echo "frpc is runing....."
fi