共计 1540 个字符,预计需要花费 4 分钟才能阅读完成。
初始环境:
[注:测试主机已设置好软件源,虚拟主机默认是 root 用户登录]
[]:~/tmp# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.9 (stretch)
Release: 9.9
Codename: stretch
[]:~/tmp#
目标环境:
[docker+]
php-7.3.6
redis-5.0.5
memcached-1.5.16
openresty-1.15.8.1(nginx+lua)
mysql-8.0.16
mongodb-4.0.10
一、前期准备
1、文件列表(mysql 选择的是 debian、x64、server 版)
https://www.php.net/distributions/php-7.3.6.tar.xz
http://download.redis.io/releases/redis-5.0.5.tar.gz
https://memcached.org/files/memcached-1.5.16.tar.gz
https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-community-server-dbgsym_8.0.16-2debian9_amd64.deb
https://openresty.org/download/openresty-1.15.8.1.tar.gz
https://fastdl.mongodb.org/src/mongodb-src-r4.0.10.tar.gz
2、依赖准备
PHP:apt-get install curl libxml2-dev libssl-dev libzip4 libzip-dev libbz2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libgmp-dev libgmp3-dev libcurl4-gnutls-dev librecode-dev libreadline-dev libtidy-dev libxslt1-dev -y
OpenResty:apt-get install libpcre3-dev libssl-dev perl make build-essential curl -y
3、docker 准备
环境搭建使用 docker,参考相应官网:《Debian 安装 Docker》、《使用清华源安装 docker》
[]:~/tmp# vim docker_install.sh
#!/bin/bash
#1. 卸载旧版本
apt-get remove docker docker-engine docker.io
#2. 安装依赖
apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y
#3.
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
#4. x86_64 添加软件仓库
add-apt-repository "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian $(lsb_release -cs) stable"
#5. 更新源并安装
apt-get update && apt-get install docker-ce -y
[]:~/tmp# chmod +x docker_install.sh && ./docker_install.sh
第一步准备完成
正文完