OP快捷运维系统一键安装脚本
##安装docker
yum install -y yum-utils device-mapper-persistent-data lvm2 nfs-utils conntrack-tools
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum install -y docker-ce-18.09.8 docker-ce-cli-18.09.8
systemctl daemon-reload
systemctl enable docker
systemctl restart docker
systemctl status docker
docker info |grep Version
##启动opserver
docker run -it -d --name docker-opserver -p 8080:8080 -v /data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=test123123 opcache/opserver:v1.1
##启动opclient
cd /opt/
wget https://opcache.com/download/opclient.tar.gz
tar zxvf opclient.tar.gz
cd opclient
bash start.sh start 127.0.0.1:8080
##配置nginx
mkdir -p /opt/nginx/conf.d
mkdir -p /data/nginx-log
cd /opt/nginx/conf.d
cat > /opt/nginx/conf.d/www.test.com.conf<< EOF
server {
server_name -;
listen 80 default;
index index.php index.html index.htm;
charset utf-8;
location / {
proxy_set_header X-Forwarded-For \$remote_addr;
proxy_set_header X-Forwarded-Host \$server_name;
proxy_set_header X-real-ip \$remote_addr;
proxy_set_header Host \$host;
proxy_set_header X-Forwarded-Proto \$scheme;
proxy_http_version 1.1;
proxy_pass http://127.0.0.1:8080;
}
access_log /data/nginx-log/www.test.com.access.log access;
error_log /data/nginx-log/www.test.com.error.log error;
}
EOF
##启动openresty
docker run -it -d --name docker-nginx11 --net=host -v /data/nginx-log:/data/nginx-log -v /opt/nginx/conf.d:/etc/nginx/conf.d -v /data/wwwroot:/data/wwwroot opcache/danmp:waf-v1