ubuntu 安装mysql+redis+nginx

1. mysql安装

vim /etc/apt/sources.list 

追加一下内容

deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# 清华镜像源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
sudo apt update    # 更新镜像源
# 安装MySQL5.7(需要输入两次mysql的root用户的密
sudo apt install -y mysql-server-5.7

#密码
Aisheji%188588

配置开机自启动

systemctl restart mysql
systemctl enable mysql

2. redis安装

 sudo apt install redis-server -y

 修改配置

vim /etc/redis/redis.conf 

# 注释掉绑定地址#bind 127.0.0.1,让Redis可远程访问
bind 0.0.0.0 ::1

#取消注释requirepass 启动密码认证,并设置访问密码
requirepass Z3OvRFiTiKN@8*N18hKDF

# 以守护进程运行Redis 
daemonize yes
systemctl restart redis-server
systemctl enable redis-server

3.安装nginx

sudo apt install -y nginx
sudo systemctl restart nginx
sudo systemctl enable nginx

 

posted @   王竹笙  阅读(31)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
点击右上角即可分享
微信分享提示