怎样自助建网站-【教程】看板娘接口迁移至 Do

阅读  ·  发布日期 2021-04-14 22:35  ·  admin
--------

怎样自助建网站

-------

实际上一年前刚开始时兴 Docker 的情况下就专业布署了一台 v凡科抠图 尝试折腾 .. (懒

但是终究在看到 @lwl12 的「升级至第三代服务器自然环境 | Docker 萌新体验记」后刚开始方案所有转移

随后又 咕咕咕咕 了 2 个月,直至 近期

考虑到到我 v凡科抠图 连接点并不是太多 .. 也用不上 均衡负载 之类

就无需 Deploy.sh 的布署方式,立即实行指令布署了 (关键還是懒

下面指令根据 CentOS 7 x64 自然环境,别的 Linux 将会不可用

这里立即把布署全过程贴出来了   提议先到「页尾」查询「有关组件」的 README

# 改动 Hostname (按需改动)

sid="cn-gz-01"
sed -i "s/$HOSTNAME/$sid.node.wxw.moe/g" /etc/hosts
hostname "$sid.node.wxw.moe"
echo -e "$sid.node.wxw.moe" /etc/hostname

# 别的自然环境主要参数设定 (按需挑选)

# 禁用 selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
# 改动系统软件时区
ln -sf /usr//Asia/Shanghai /etc/localtime
# 改动系统软件語言自然环境
echo 'LANG="en_US.UTF-8"' /etc/profile;source /etc/profile
# 关掉并停用 firewall 防火墙
systemctl stop firewalld.service systemctl disable firewalld.service

# 建立 SWAP (按需挑选)

dd if=/dev/zero of=/swap bs=1M count=2048
chmod 0600 /swap
mkswap /swap
swapon /swap
echo '/swap none swap defaults 0 0' /etc/fstab

# 启用 BBR 优化算法 (按需挑选)

yum install centos-release-xen-48 -y
yum upgrade kernel -y
reboot
uname -a
echo 'net.ipv4.tcp_fastopen=3' | tee -a /etc/sysctl.conf
echo 'net.core.default_qdisc=fq' | tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' | tee -a /etc/sysctl.conf
yum remove centos-release-xen-48 -y
sysctl -p
lsmod | grep bbr

# Kernel 特性调优 (按需挑选)

vi /etc/sysctl.conf
net.ipv4.ip_forward=1
net.bridge.bridge-nf-call-iptables=1
net.ipv4.neigh.default.gc_thresh1=4096
net.ipv4.neigh.default.gc_thresh2=6144
net.ipv4.neigh.default.gc_thresh3=8192
sysctl -p

# 安裝 Docker 自然环境

# 移除旧版 Docker
yum remove docker \
 docker-client \
 docker-client-latest \
 mon \
 docker-latest \
 docker-latest-logrotate \
 docker-logrotate \
 docker-selinux \
 docker-engine-selinux \
 docker-engine
# 安裝依靠
yum install -y yum-utils \
 device-mapper-persistent-data \
 lvm2
# 加上 docker-ce 源
yum-config-manager --add-repo linux/centos/docker-ce.repo
# yum-config-manager --add-repo docker-ce/linux/centos/docker-ce.repo (中国可选
# 安裝 docker-ce
yum install docker-ce
systemctl enable docker
systemctl start docker
docker version
# pose
COMPOSE_VERSION=$(curl -s pose/releases/latest | grep 'tag_name' | cut -d\" -f4)
curl -L "pose/releases/download/${COMPOSE_VERSION}/pose-$(uname -s)-$(uname -m)" -o /usr/local/pose
chmod +x /usr/local/pose
ln -s /usr/local/pose /usr/pose
pose --version

# 布署 LNMP 自然环境

# 建立內部互联网
work create fsn
# 对接 php 管理权限组
groupadd -g 82 www
useradd -g 82 -u 82 www

## Portainer (按需挑选)

docker run -d --name portainer --restart always \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -v /root/docker_data/portainer:/data \
 -v /etc/localtime:/etc/localtime:ro \
 --network fsn portainer/portainer

## Nginx (用了 VeryNginx 镜像系统)

mkdir -p /root/docker_data/nginx
curl -fSL fghrsh/FSN_Nginx_Docker/verynginx/conf/nginx.conf /root/docker_data/nginx/nginx.conf
curl -fSL fghrsh/FSN_Nginx_Docker/verynginx/verynginx/configs/config.json /root/docker_data/nginx/verynginx.json
chown -R www:www /root/docker_data/nginx
# 改动 nginx.conf 主要参数
vim /root/docker_data/nginx/nginx.conf
 strict_sni off; # 阿里巴巴云 CDN 不适用 SNI 回源
 more_set_headers 'NodeInfo: FSN / CN-GZ-01 / FS5.online';
docker run -d --restart always \
 -p 80:80 -p 443:443 --name nginx \
 -v /data/wwwroot:/data/wwwroot \
 -v /data/wwwlogs:/data/wwwlogs \
 -v /etc/localtime:/etc/localtime:ro \
 -v /root/docker_data/nginx/ssl:/etc/nginx/ssl:ro \
 -v /root/docker_data/nginx/vhosts:/etc/nginx/vhosts:ro \
 -v /root/docker_data/nginx/nginx.conf:/etc/nginx/nginx.conf:ro \
 -v /root/docker_data/nginx/verynginx.json:/opt/verynginx/configs/config.json \
 --network fsn fghrsh/fsn_nginx:verynginx

## MySQL 8.0

# 物理学运行内存 1GB 不提议应用 MySQL 8.0
mkdir -p /root/docker_data/mysql/conf
curl -L "lwl12/LFS-Docker-Compose/058a94a559e1555ff8286e5a9be96/config/mysql/f" -o /root/docker_data/mysql/conf/f
docker run -d --restart always \
 -v /etc/localtime:/etc/localtime:ro \
 -v /root/docker_data/mysql/log:/var/log/mysql \
 -v /root/docker_data/mysql/data:/var/lib/mysql \
 -v /root/docker_data/mysql/conf:/etc/mysql/conf.d:ro \
 -e MYSQL_ROOT_PASSWORD="MySQL ROOT 登陆密码" --name mysql \
 --network fsn mysql:8.0

## SMProxy (按需挑选)

mkdir -p /root/docker_data/smproxy/conf
vim /root/docker_data/smproxy/conf/server.json
vim /root/docker_data/smproxy/conf/database.json
docker run -d --restart always --name smproxy \
 -v /etc/localtime:/etc/localtime:ro \
 -v /root/docker_data/smproxy/conf:/usr/local/smproxy/conf \
 -v /root/docker_data/smproxy/logs:/usr/local/smproxy/logs \
 --network fsn fghrsh/fsn_smproxy

## Redis 5

docker run -d --restart always --name redis \
 -v /root/docker_data/redis/log:/var/log/redis \
 --network fsn redis:5-alpine

## PHP 7.3

mkdir /root/docker_build
mkdir -p //fpm
curl -L "fghrsh/FSN_PHP_Docker/7.3/php.ini" -o //php.ini
curl -L "fghrsh//fpm/docker.conf" -o //fpm/docker.conf
# 挂载文件目录按需调剂
docker run -d --restart always \
 -v /data/wwwroot:/data/wwwroot \
 -v /data/wwwlogs:/data/wwwlogs \
 -v /etc/localtime:/etc/localtime:ro \
 -v /root/docker_data:/usr/local/docker/data \
 -v /root/docker_build:/usr/local/docker/build \
 -v //php.ini:/usr//php.ini:ro \
 -v //fpm/docker.conf:/usr/-fpm.d/zz-docker.conf:ro \
 --network fsn --name php :7.3

## KodExplorer (按需挑选)

mkdir -p /data/wwwroot/$HOSTNAME/kod
vim /root/docker_data/nginx/vhosts/$HOSTNAME.conf
server {
 listen 80;
 listen 443 ssl http2;
 include /opt/verynginx/nginx_conf/in_server_block.conf;
 -gz-01.node.wxw.moe;
 root /data/-gz-01.node.wxw.moe;
  index.htm index.php;
 ssl_certificate /etc/nginx/ssl/star.node.wxw.moe.crt;
 ssl_certificate_key /etc/nginx/ssl/star.node.wxw.moe.key;
 if ($scheme = http) { return 301 data/-gz-01.node.wxw.moe;
 fastcgi_param SCRIPT_FILENAME /data/-gz-01.node.wxw.moe$fastcgi_script_name;
 include fastcgi.conf;
 access_log /data/-gz-01.node.wxw.moe-access.log main;
 error_log /data/-gz-01.node.wxw.moe-error.log crit;
}
cd /data/wwwroot/$HOSTNAME/kod
wget update/download/kodexplorer4.37.zip
unzip kodexplorer4.37.zip
rm -f kodexplorer4.37.zip
chmod -Rf 777 ./*

## Uptime Robot Page (按需挑选)

mkdir -p /root/docker_data/uptimerobot-page
curl -L "giuem/uptimerobot-page/master/config/default.yml" -o /root/docker_data/uptimerobot-page/default.yml
vim /root/docker_data/uptimerobot-page/default.yml
# default configure
 port: 3000
 log_level: info
 crontime: "*/1 * * * *"
uptimerobot:
 api_key: "Uptime Robot API KEY"
 pattern: "%index/%group/%name"
 statuses: "2-9"
website:
 title: "FGHRSH Services Status"
 copyright: "FGHRSH"
 links:
 - name: wxw.moe
 href: /
 - name: 
 href: pre>
docker run -d --restart always \
 -v /root/docker_data/uptimerobot-page:/app/config:ro \
 --network fsn --name uptimerobot-page giuem/uptimerobot-page
vim /root/docker_data/nginx/vhosts/fs5.online.conf
u凡科抠图tream uptimerobot-page {
 server uptimerobot-page:3000;
server {
 listen 80;
 include /opt/verynginx/nginx_conf/in_server_block.conf;
 server_name fs5.online;
 location / {
 add_header X-Cache-Status $u凡科抠图tream_cache_status;
 proxy_pass data/wwwlogs/fs5.online-access.log main;
 error_log /data/wwwlogs/fs5.online-error.log crit;
}

## 最终一步

# 同歩 SSL 资格证书 (独享库房,按需改动)
git clone fghrsh/fsn_ssl_cert.git /root/docker_data/nginx/ssl
# 管理权限调剂
setfacl -R -m u:www:rwx /root/docker_data
setfacl -R -m u:www:rwx /root/docker_build
chown -R www:www /data/wwwroot
chown -R www:www /data/wwwlogs
# 重新启动 Nginx 载入配备
docker restart nginx
# 没法起动时 查寻系统日志 用
# docker logs -f -t --tail=20 nginx | less
# 登陆 # 改动默认设置客户
# 登陆 kod 进行原始化设定(如有)

至此新连接点就布署进行了 ···

docker run 方法比较灵便,有关文件目录、主要参数能够 按需修改

万物皆可 Docker (大雾

随后把各项服务都塞进了 Docker 镜像系统里(Alpine Linux 真香

FGHRSH Service Node Infrastructure 系列组件

PHP: fghrsh/FSN_PHP_Docker Nginx: fghrsh/FSN_Nginx_Docker SMProxy: fghrsh/FSN_SMProxy_Docker

别的用到的组件

Gitea: go-gitea/gitea SMProxy: louislivi/SMProxy Portainer: portainer/portainer VeryNginx: alexazhou/VeryNginx uptimerobot-page: giuem/uptimerobot-page

参照

「升级至第三代服务器自然环境 | Docker 萌新体验记」 LFS-Bash-Deploy: lwl12/LFS-Bash-Deploy LFS-Docker-PHP: lwl12/LFS-Docker-PHP LFS-Docker-Nginx: lwl12/LFS-Docker-Nginx LFS-Docker-Compose: lwl12/LFS-Docker-Compose
E企盈小程序欢迎你!小程序营销卖货系统软件!小程序直播间卖货系统软件!小程序卖货系统软件订制!手机微信大屏互动抽奖系统软件!微信公众号分销卖货系统软件!微信公众号方式代理商系统软件!微信公众号全世界分紅系统软件!助力天地做生意一起盈!!!
热线:
招商朝理:
石总:
黄总:
陈总:
骆总:E企盈E企盈小程序视頻 wp-content/uploads/2020/03/9924a176c7f0352c23a8b010e1eff366-1.mp4活跃读者 2020年四月 ---------

怎样自助建网站

------------