Linux前后端环境配置 docker-ce
https://developer.aliyun.com/mirror/docker-ce
1 2 3 4 5 6 7 8 9 10 11 sudo yum install -y yum-utils device-mapper-persistent-data lvm2 sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo sudo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo sudo yum makecache fast sudo yum -y install docker-ce sudo service docker start
https://hub.docker.com/_/mysql
1 2 3 4 5 6 7 8 9 10 docker run -itdp 3307:3306 \ --name mysql \ --restart=always \ -e MYSQL_ROOT_PASSWORD=db123456 \ -e TZ=Asia/Shanghai \ -v /data/mysql:/var/lib/mysql \ mysql:5.7 \ --character-set-server=utf8 \ --collation-server=utf8_unicode_ci \ --character-set-client-handshake=FALSE
MYSQL 常见变量 MYSQL_ROOT_PASSWORD MYSQL_DATABASE MYSQL_USER, MYSQL_PASSWORD MYSQL_ALLOW_EMPTY_PASSWORD MYSQL_RANDOM_ROOT_PASSWORD MYSQL_ONETIME_PASSWORD MYSQL_INITDB_SKIP_TZINFO
https://hub.docker.com/_/redis
1 2 3 4 5 6 7 docker run -itdp 6379:6379 \ --name redis \ --privileged=true \ --restart=always \ -v /data/redis/data:/data \ redis:latest \ --requirepass "redisPassword"
注意:**–requirepass** 参数是redis参数要放在镜像的后面
https://hub.docker.com/_/nginx
1 2 3 4 5 docker run -idtp 80:80 \ --name nginx \ --restart=always \ -v /data/nginx:/usr/share/nginx/html \ nginx:latest
jdk
https://www.oracle.com/java/technologies/downloads/#java8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 [root@quanlook ~]# ls jdk-8u261-linux-x64.tar.gz [root@quanlook ~]# tar -xzf jdk-8u261-linux-x64.tar.gz -C /usr/local/src/ [root@quanlook ~]# ls /usr/local/src/ jdk1.8.0_261 [root@quanlook ~]# vim /etc/profile export JAVA_HOME=/usr/local/src/jdk1.8.0_261 export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$PATH [root@quanlook ~]# source /etc/profile [root@quanlook ~]# java -version java version "1.8.0_261" Java(TM) SE Runtime Environment (build 1.8.0_261-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode) [root@quanlook ~]#
nodejs node 版本管理器
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash [root@quanlook ~] [root@quanlook ~] total 12 drwxr-xr-x 8 10143 10143 4096 Jun 18 2020 jdk1.8.0_261 drwxr-xr-x 2 root root 4096 Nov 16 21:02 node drwxr-xr-x 2 root root 4096 Nov 16 21:06 nvm [root@quanlook ~] Cloning into '/usr/local/src/nvm' ... remote: Enumerating objects: 8526, done . remote: Counting objects: 100% (269/269), done . remote: Compressing objects: 100% (165/165), done . remote: Total 8526 (delta 146), reused 198 (delta 100), pack-reused 8257 Receiving objects: 100% (8526/8526), 3.16 MiB | 1.16 MiB/s, done . Resolving deltas: 100% (5371/5371), done . [root@quanlook ~] export NVM_DIR=/usr/local/src/node source /usr/local/src/nvm/nvm.sh EOF [root@quanlook ~] [root@quanlook ~] Downloading and installing node v16.10.0... Downloading https://nodejs.org/dist/v16.10.0/node-v16.10.0-linux-x64.tar.xz... Computing checksum with sha256sum Checksums matched! Now using node v16.10.0 (npm v7.24.0) [root@quanlook ~] v16.4.0 -> v16.10.0 default -> 16.4.0 (-> v16.4.0) iojs -> N/A (default) unstable -> N/A (default) node -> stable (-> v17.1.0) (default) stable -> 17.1 (-> v17.1.0) (default) lts/* -> lts/gallium (-> v16.13.0) lts/argon -> v4.9.1 (-> N/A) lts/boron -> v6.17.1 (-> N/A) lts/carbon -> v8.17.0 (-> N/A) lts/dubnium -> v10.24.1 (-> N/A) lts/erbium -> v12.22.7 (-> N/A) lts/fermium -> v14.18.1 (-> N/A) lts/gallium -> v16.13.0 [root@quanlook ~] Now using node v16.4.0 (npm v7.18.1) [root@quanlook ~] v16.4.0 [root@quanlook ~]