1、安装java
可参考ubuntu-16.04,没区别 https://blog.csdn.net/qq_38959934/article/details/126101028
2、安装 firewalld
可参考ubuntu-16.04,没区别 https://blog.csdn.net/qq_38959934/article/details/126101028
3、安装 mysql5.7
apt-get install mysql-server
默认安装的是8.0.
可参考:https://zhuanlan.zhihu.com/p/348317883 安装5.7
3.1、下载安装包(这里以5.7.32为例)
官方地址:https://downloads.mysql.com/archives/community/
这里下载的是 Ubuntu Linux 18.04 (x86, 64-bit), DEB Bundle
3.2、解压安装包
cd /usr/local
mkdir mysql_package
下载mysql5.7上传到 mysql_package 目录下,解压文件
cd mysql_package
tar -xf mysql-server_5.7.32-1ubuntu18.04_amd64.deb-bundle.tar
3.3、安装MySQL5.7.32
- 更新依赖源及安装libaio1、libtinfo5依赖
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libaio1
sudo apt-get install libtinfo5
- 按下列顺序安装(提示缺少依赖可更换顺序)
进入到 /usr/local/mysql_package目录
sudo dpkg -i mysql-common_5.7.32-1ubuntu18.04_amd64.deb
sudo dpkg-preconfigure mysql-community-server_5.7.32-1ubuntu18.04_amd64.deb #此步需要输入数据的root密码
sudo dpkg -i libmysqlclient20_5.7.32-1ubuntu18.04_amd64.deb
sudo dpkg -i libmysqlclient-dev_5.7.32-1ubuntu18.04_amd64.deb
sudo dpkg -i libmysqld-dev_5.7.32-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-community-client_5.7.32-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-client_5.7.32-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-common_5.7.32-1ubuntu18.04_amd64.deb
- 继续安装依赖
sudo apt-get -f install
sudo apt-get -f install libmecab2
- 安装mysql-server
sudo dpkg -i mysql-community-server_5.7.32-1ubuntu18.04_amd64.deb
sudo dpkg -i mysql-server_5.7.32-1ubuntu18.04_amd64.deb
- 检测安装
mysql -u root -p
3.4、查看端口、远程访问
可参考ubuntu-16.04,没区别 https://blog.csdn.net/qq_38959934/article/details/126101028
4、安装Redis 6.0
参考了 https://www.xtuos.com/6254.html、https://blog.csdn.net/houor/article/details/126672577
首先,通过在终端中运行以下命令,确保所有系统包都是最新的。
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install wget apt-transport-https gnupg2 software-properties-common
sudo apt-get install redis-server # 在 Ubuntu 22.04 上安装 Redis。
命令验证状态:
sudo systemctl enable redis
sudo systemctl start redis
sudo systemctl status redis
sudo systemctl restart redis
确认安装并检查已安装的 Redis 构建版本:
redis-server -v
进入redis
redis-cli
配置 Redis
/etc/redis/redis.conf
# bind 127.0.0.1 注释这一行 为了远程连接
daemonize no 改为 daemonize yes 守护进程
protected-mode yes 改为 protected-mode no
配置完成后,保存并关闭文件。然后重启Redis:
systemctl restart redis-server
执行以下命令打开防火墙端口6379
firewall-cmd --zone=public --add-port=6379/tcp --permanent
firewall-cmd --reload #重启firewall
firewall-cmd --list-ports #查看已经开放的端口
使用 RedisDesktopManager 测试连接:
下面的方法安装失败了
下载并解压安装包
cd /usr/local/src ---下载到这个 路径下
wget http://download.redis.io/releases/redis-5.0.3.tar.gz ---下载
tar -zxvf redis-5.0.3.tar.gz
切换到解压目录,编译
cd redis-5.0.3
make
提示 make
找不到,安装 ‘make’ 指令,然后再次输入 make:
apt-get install make
提示/bin/sh: 1: cc: not found
,安装gcc
sudo apt-get install gcc
提示zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: No such file or directory 50 | #include <jemalloc/jemalloc.h>
https://blog.csdn.net/weixin_35757704/article/details/119280758
sudo make MALLOC=libc
安装并指定目录
make install PREFIX=/usr/local/redis
5、安装FastDFS & nginx1.18
可参考ubuntu-16.04,没太大区别 https://blog.csdn.net/qq_38959934/article/details/126101028
https://blog.csdn.net/qq_38959934/article/details/117227466
安装nginx编译时 可能遇到的错误:
正确的做法:
https://blog.csdn.net/weixin_42510813/article/details/118354552
/usr/local/fastdfs-nginx-module/src/common.c file_id[128] 改为 file_id[512]
下面是错误的做法:
进入对应的文件注释对应的代码:
为了debug开启log:
开启log,注释上面的两行代码会出现400错误。