一、安装MySQL
链接教程 : https://blog.csdn.net/zhan107876/article/details/100708499/
先进行查看是否有mysql 其中的-i是不区分大小写
rpm -qa | grep -i mysql
一、上传安装包到Linux
1、传路径:/usr/local/
/usr/local/
2、解压缩
tar -xvf mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz
3、重命名
mv mysql-8.0.17-linux-glibc2.12-x86_64 mysql
二、安装配置
1、修改 vi /etc/my.cnf
vi /etc/my.cnf
[client]
port=3306
socket=/var/lib/mysql/mysql.sock
[mysqld]
port=3306
user=mysql
socket=/var/lib/mysql/mysql.sock
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
2、创建mysql组与用户
groupadd mysql
useradd -g mysql mysql
先将依赖上传到文件夹,进入执行
rpm -ivh libaio-0.3.109-13.el7.x86_64.rpm
3、记得先创建data目录在mysql下,在进行初始化mysql
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
!!!记录初始密码:
mkdir -p /var/lib/mysql ; chown -R mysql:mysql /var/lib/mysql
ln -s /usr/local/mysql/bin/mysql /usr/bin
/usr/local/mysql/support-files/mysql.server start
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123456aA';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root123456aA';
use mysql;
update user set host='%' where user='root';
flush privileges;
exit;
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
chkconfig mysql on
chkconfig --add mysql
二、安装Java环境
https://blog.csdn.net/weixin_43520670/article/details/106344655
0、验证java -version
1、创建java目录
mkdir /usr/local/java
cd /usr/local/java
2、解压文件 tar -zxvf jdk-8u221-linux-x64.tar.gz
3、修改配置文件 vi /etc/profile
## 使用i插入模式,在末尾添加
JAVA_HOME=/usr/local/java/jdk1.8.0_221
CLASSPATH=%JAVA_HOME%/lib:%JAVA_HOME%/jre/lib
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export PATH CLASSPATH JAVA_HOME
## :wq 保存退出
4、刷新配置 `source /etc/profile`
5、验证java -version
三、安装Redis
1、创建文件夹,并进入
mkdir /usr/local/redis
cd /usr/local/redis
2、传文件,并解压
tar -xzvf redis-4.0.8.tar.gz
3、解压之后
// 进入解压目录
cd redis-4.0.8
// 执行make命令
make
// 进入src目录
cd src
// 执行
make install PREFIX=/usr/local/redis
4、移动配置文件到安装目录下
mkdir /usr/local/redis/etc
cd ../
mv redis.conf /usr/local/redis/etc
5、修改配置文件,
vim /usr/local/redis/etc/redis.conf
6、将 bind 127.0.0.1 注释掉,protected-mode为yes改为no ,将daemonize no 改成daemonize yes
7、启动
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
8、自动启动设置
// 修改/etc/rc.d/rc.local,
// 在里面添加内容:/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf (开机时就会自动调用这段开启redis的命令)
vim /etc/rc.d/rc.local
// 添加内容保存退出后,执行下面命令将/etc/rc.d/rc.local变成可执行文件
chmod +x /etc/rc.d/rc.local
四、安装Nginx
yum install yum-utils
yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
yum install openresty
yum install openresty-resty
## 默认目录为/usr/local/openresty
## 进入nginx目录
## sbin/nginx -c conf/nginx.conf
## nginx无缝重启命令:sbin/nginx -s reload
nginx开机自启 https://blog.csdn.net/fei1234456/article/details/107234075/
## 配置文件修改后,
vim /usr/local/openresty/nginx/conf/nginx.conf
##需要指定配置文件进行重启:
/usr/local/openresty/nginx/sbin/nginx -s reload -c /usr/local/openresty/nginx/conf/nginx.conf
## 修改/etc/rc.d/rc.local文件 添加如下内容
/usr/local/openresty/nginx/sbin/nginx
## 执行以下命令,使/etc/rc.d/rc.local变成可执行文件。
chmod +x /etc/rc.d/rc.local
离线安装
https://www.codenong.com/cs106499283/
https://blog.csdn.net/achi010/article/details/106392040
https://blog.csdn.net/caopeng721210/article/details/108000688
在home新建t1 t2 t3文件夹
t1上传需要的gcc依赖,进行编译
rpm -Uvh *.rpm --nodeps --force
t3上传Openresty和需要的依赖
tar -zxvf openresty-1.15.8.3.tar.gz
tar -zxvf openssl-1.1.1l.tar.gz
tar -zxvf pcre-8.41.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd bundle/LuaJIT-2.1-20190507/
make clean && make && make install
ln -sf luajit-2.1.0-alpha /usr/local/bin/luajit
安装组件
cd bundle #进入bundle目录下面,然后上传下载好的两个压缩包
#解压即可
tar -xvf ngx_cache_purge-2.3.tar.gz
tar -xvf nginx_upstream_check_module-0.3.0.tar.gz
返回安装目录 cd ../
./configure --prefix=/home/t2 --with-pcre=../pcre-8.41 --with-openssl=../openssl-1.1.1l --with-zlib=../zlib-1.2.11
make && make install
这样t2存在一个nginx
cd /home/t2/nginx/sbin
修改配置文件,
cd /home/t2/nginx/conf
vim nginx.conf
启动 ./nginx 刷新配置文件./nginx -s reload
TODO自动重启测 ./nginx -s reload
cd /home/t2/nginx/sbin
./nginx