目录

[TOC]

nginx

1.22.1

直接使用下面的脚本命令,一键安装nginx

1
yum -y install wget && wget https://www.naste.top:9000/file/shell/nginx/1.22.1/install-nginx.sh --no-check-certificate && chmod +x install-nginx.sh && ./install-nginx.sh

install-nginx.sh脚本内容,install-nginx.sh以该文档中的内容为准

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
#!/bin/bash

# 安装相关依赖
yum install -y gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel vim wget

# 下载nginx
wget https://nginx.org/download/nginx-1.22.1.tar.gz

# 解压压缩包
tar -xvf nginx-1.22.1.tar.gz

# 进入解压后的目录
cd nginx-1.22.1

# 执行`configure`编译nginx看是否还有错误 (可以使用【--prefix=`指定目录`】命令来指定安装目录)
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module

# 编译和安装
make && make install

# 创建nginx服务文件
touch /usr/lib/systemd/system/nginx.service

# 输入内容
sudo tee /usr/lib/systemd/system/nginx.service <<-'EOF'
[Unit]
Description=nginx
After=network.target

[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true

[Install]
WantedBy=multi-user.target
EOF

# 启动nginx
systemctl start nginx

# 设置nginx开机启动
systemctl enable nginx

Docker

latest

直接使用下面的脚本命令,一键安装nginx

1
yum -y install wget && wget https://www.naste.top:9000/file/shell/docker/latest/install-docker.sh --no-check-certificate && chmod +x install-docker.sh && ./install-docker.sh
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
#!/bin/bash

# 1、卸载旧版本
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine

# 2、需要的安装包
yum install -y yum-utils

# 3、设置stable镜像仓库(设置镜像仓库,走装阿里云镜像)
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# 4、更新yum软件包索引
yum makecache fast

# 5、安装DOCKER CE
yum -y install docker-ce docker-ce-cli containerd.io

# 6、设置镜像加速
mkdir -p /etc/docker

touch /etc/docker/daemon.json

sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": [
"https://x3mwd92e.mirror.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn/",
"https://hub-mirror.c.163.com/",
"https://reg-mirror.qiniu.com"
]
}
EOF

# 7、启动docker
sudo systemctl daemon-reload

sudo systemctl restart docker

# 8、设置开机启动
systemctl enable docker

Docker-Compose

下载地址:https://github.com/docker/compose/releases/