docker
#!/bin/bash
if [ -z "$(rpm -qa | grep yum-utils)" ]; then
yum install -y yum-utils
fi
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum -y install docker-ce docker-compose
nginx
#!/bin/bash
nginx_name="nginx-1.18.0.tar.gz"
if [ -z "$(rpm -qa | grep wget)" ]; then
yum install -y wget
fi
wget -c http://nginx.org/download/${nginx_name}
tar -zxf ${nginx_name}
cd ${nginx_name%%.tar.gz}
yum install -y openssl-devel
./configure \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_auth_request_module \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx/nginx.pid \
--lock-path=/var/run/nginx/nginx.lock \
--error-log-path=/var/log/nginx/error.log
make
make install
echo "Check whether nginx default config contain aliyun setting?"
grep -rn -A 3 -B 2 "listen 3000" /usr/local/nginx/conf/nginx.conf