查看系统版本
lsb_release -a
yum install git
简单方便、但是装的1.8.x的版本
# 执行以下命令下载源文件
wget https://github.com/git/git/archive/v2.24.1.tar.gz
# 解压安装包
tar -zxvf v2.24.1.tar.gz
# 安装编译源码所需依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
# 卸载旧版本Git
yum remove git
# 编译
cd git-2.24.1/
make prefix=/usr/local/src/git all
# 安装
make prefix=/usr/local/src/git install
# 配置环境变量
vim /etc/profile
# 在底部的path变量结尾加上相关配置信息即可
PATH=$PATH:/usr/local/src/git/bin
# 保存并更新环境配置
source /etc/profile
# 验证
export | grep git
git --version
rpm -qa | grep mysql
# 如果安装过别版本执行删除
rpm -e --nodeps mysql-xxxxxxxxx
whereis mysql
find / -name mysql
# 如果有预留都删除干净
rm -rf xxx xxx
cat /etc/group | grep mysql
cat /etc/passwd |grep mysql
groupadd mysql
useradd -r -g mysql mysql
# 如果你的linux 系统有外网,则直接通过命令下载到linux系统上:
wget https://dev.mysql.com/get/Downloads/MySQL-8.0.20/mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz
# 也可以直接到官网 https://downloads.mysql.com/archives/community/ 直接下载
tar -xvf mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz
mv mysql-8.0.20-linux-glibc2.12-x86_64 /usr/local/mysql
# mysql文件夹要配置为755的权限,如果不是则执行命令:
chmod -R 755 /usr/local/mysql
mkdir -p /data/mysql
如果遇到了mysql.sock无法找到和其他无法写的权限等问题,给这个目录权限设置为:chmod 777 /data/mysql
[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
#symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
bind-address=127.0.0.1
port=3306
user=mysql
basedir=/usr/local/mysql
datadir=/data/mysql
socket=/tmp/mysql.sock
#socket=/data/mysql/mysql.sock
log-error=/data/mysql/mysql.err
pid-file=/data/mysql/mysql.pid
##character config
character_set_server=utf8mb4
symbolic-links=0
explicit_defaults_for_timestamp=true
[mysqld_safe]
#log-error=/var/log/mariadb/mariadb.log
log-error=/data/mysql/mariadb.log
#pid-file=/var/run/mariadb/mariadb.pid
pid-file=/data/mysql/mariadb.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
./mysqld --initialize --user=mysql --datadir=/data/mysql --basedir=/usr/local/mysql
# 查看初始密码
cat /data/mysql/mysql.err
# 先将mysql.server放置到/etc/init.d/mysql中
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
service mysql start
ps -ef | grep mysql
# 首先登录mysql,密码是上述初始化时,日志最后一行生成的那个临时密码
./mysql -u root -p #bin目录下
./mysql -uroot -h 127.0.0.1 -p
# 注意:对于8.0.20版本的mysql,使用以前的修改密码的命令不可用,无法使用set password命令
# 需要使用alert命令去修改,执行命令
ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxxxx';
FLUSH PRIVILEGES;
use mysql;
update user set user.Host='%' where user.User='root';
flush privileges;
参考:https://www.cnblogs.com/qinshizhishi/p/13821432.html
wget https://download.redis.io/releases/redis-6.2.11.tar.gz
tar -zvxf redis-5.0.7.tar.gz
mv /root/redis-5.0.7 /usr/local/redis
cd /usr/local/redis
make
make PREFIX=/usr/local/redis install
# PREFIX= 这个关键字的作用是编译的时候用于指定程序存放的路径。比如我们现在就是指定了redis必须存放在/usr/local/redis目录。假设不添加该关键字Linux会将可执行文件存放在/usr/local/bin目录
#采取后台进程方式
./bin/redis-server & ./redis.conf
#采取显示启动方式
./bin/redis-server ./redis.conf
ps -aux | grep redis
# 采取端口监听查看方式
netstat -lanp | grep 6379
输入redis-cli 进入控制台后输入命令shutdown即可关闭运行中的Redis服务了
yum install gcc-c++
yum install -y openssl openssl-devel
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
```shell
4. 创建nginx文件夹
```shell
mkdir /usr/local/nginx
wget https://nginx.org/download/nginx-1.19.9.tar.gz
也可以下载到本地,然后上传到服务器
tar -zxvf nginx-1.19.9.tar.gz
cd nginx-1.19.9
./configure
make && make install
whereis nginx
./nginx
ps -ef | grep nginx
如果觉得每次到安装目录下的sbin使用 ./nginx执行比较麻烦 可以配置 nginx命令
vim /etc/profile
# 在后面加入
PATH=$PATH:/usr/local/nginx/sbin #你的安装路径
export PATH
# :wq保存退出 重载profile
source /etc/profile
然后就可以随心使用 nginx xxx 命名了
wget https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.xz
tar -xvf node-v13.11.0-linux-x64.tar.xz
cd node-v13.11.0-linux-x64/bin
./node -v
如果有v16.15.0输出则证明安装成功
ln -s /www/node-v13.11.0-linux-x64/bin/node /usr/local/bin/node
ln -s /www/node-v13.11.0-linux-x64/bin/npm /usr/local/bin/npm
~# node -v
v16.15.0
~# npm -v
6.14.16
然后就可以使用npm下载pnpm、yarn等