基于CentOS7
安装Redis
yum -y install gcc automake autoconf libtool make
wget https://download.redis.io/releases/redis-6.2.6.tar.gz
tar xzf redis-6.2.6.tar.gz
mv redis-6.2.6 /usr/local/redis
cd /usr/local/redis
make
如果执行make命令报错:致命错误:jemalloc/jemalloc.h: 没有那个文件或目录,则需要在make指定分配器为libc。执行下面命令即可正常编译:
make MALLOC=libc
make install PREFIX=/usr/local/redis
./bin/redis-server redis.conf
GoLang换源
golang源码镜像站 https://gomirrors.org
go version 1.14.x
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
生成项目包依赖文件go.mod
go mod init {项目名}
go mod tidy
go安装
tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz
echo "export GOROOT=/usr/local/go ##Golang安装目录" >>/etc/profile
echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >>/etc/profile
echo "export GOPATH=/home/go ##Golang项目目录" >>/etc/profile
cd /root
echo "source /etc/profile" >> .bashrc
source /etc/profile
Mysql安装
https://www.cnblogs.com/werr370/p/14633785.html
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
yum -y install mysql80-community-release-el7-3.noarch.rpm
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
yum -y install mysql-community-server
systemctl start mysqld.service
cat /var/log/mysqld.log | grep password
.默认装MySQL8.0,如需装MySQL5.7修改/etc/yum.repos.d/mysql-community.repo文件
将mysql80中enabled属性改为0,并添加如下:
mysql8重置密码
vim /etc/my.cnf +skip-grant-tables
mysql -u root -p //提示输入密码时直接敲回车。
use mysql //选择数据库
update user set authentication_string = '' where user = 'root'; //密码置空
quit //退出
ALTER USER 'root'@'localhost' IDENTIFIED BY 'dnspai.com';
Npm 安装
https://www.cnblogs.com/randysun/p/15949143.html
wget https://nodejs.org/dist/v14.15.4/node-v14.15.4-linux-x64.tar.xz
tar -xf node-v14.15.4-linux-x64.tar.xz
mv node-v14.15.4-linux-x64 /usr/local/node
cd /usr/bin
ln -s /usr/local/node/bin/node node
ln -s /usr/local/node/bin/npm npm
YUM RPM 源
http://mirrors.163.com/centos/7/os/x86_64/Packages/
问题1:type *big.Int has no field or method FillBytes
解决方案:升级golang版本>1.16.7
https://github.com/Solar-Space-Tech/Solar-Space-Server/issues/7
问题2:
Error: Node Sass version 7.0.1 is incompatible with ^4.0.0
解决方案:
npm uninstall node-sass
npm i -D sass
npm run dev
https://blog.csdn.net/m0_49714202/article/details/123483875