2.1 Linux系统下可道云网盘的安装部署

本文阅读预计需要: 5 minutes

原生安装概述

CentOS 7.9 最小安装系统 部署KodBox

软件版本

  • nginx 1.20
  • php 7.4
  • MySQL 5.7
  • redis 6.2

安装nginx

yum install yum-utils

## 配置yum源
## vi /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true

yum install nginx
systemctl start nginx
systemctl enable nginx
## 修改配置文件
## vi /etc/nginx/nginx.conf
## root /var/www/html;改成自己的站点目录
user  nginx;
worker_processes auto;
pid        /var/run/nginx.pid;

events {
    use epoll;
    worker_connections 51200;
    multi_accept on;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:2m;
    ssl_session_timeout 1h;
    ssl_session_tickets off;
    server_names_hash_bucket_size 512;
    client_header_buffer_size 32k;
    large_client_header_buffers 4 32k;
    client_max_body_size 10G;

    sendfile        on;
    tcp_nopush     on;
    tcp_nodelay on;
    keepalive_timeout 60;

    fastcgi_connect_timeout 3600;
    fastcgi_send_timeout 3600;
    fastcgi_read_timeout 3600;
    fastcgi_buffer_size 64k;
    fastcgi_buffers 4 64k;
    fastcgi_busy_buffers_size 128k;
    fastcgi_temp_file_write_size 256k;
    fastcgi_intercept_errors on;

    gzip on;
    gzip_min_length  1k;
    gzip_buffers     4 16k;
    gzip_http_version 1.1;
    gzip_comp_level 2;
    gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
    gzip_vary on;
    gzip_proxied   expired no-cache no-store private auth;
    gzip_disable   "MSIE [1-6]\.";
    server_tokens off;

        server {
                listen   80; ## listen for ipv4; this line is default and implied
                listen   [::]:80 default ipv6only=on; ## listen for ipv6

                root /var/www/html;
                index index.php index.html index.htm;
                server_name _;

                error_log  /var/log/nginx/kodbox_error.log  notice;
                access_log /var/log/nginx/kodbox_access.log main;

                location ~ [^/]\.php(/|$) {
                        try_files $uri =404;
                        fastcgi_pass unix:/var/run/php-fpm.sock;
                        fastcgi_index index.php;
                        set $path_info $fastcgi_path_info;
                        set $real_script_name $fastcgi_script_name;
                        if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
                        set $real_script_name $1;
                        set $path_info $2;
                        }
                        fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
                        fastcgi_param SCRIPT_NAME $real_script_name;
                        fastcgi_param PATH_INFO $path_info;
                        include fastcgi_params;
                }

                location ~* \.(jpg|jpeg|gif|png|css|js|ico|webp|tiff|ttf|svg)$ {
                        expires      30d;
                }

                location ~ .*\.(js|css)?$ {
                expires      12h;
                }

                location ~ /\. {
                        log_not_found off;
                        deny all;
                }

                location ^~ /.well-known {
                        allow all;
                        auth_basic off;
                }

                location = /favicon.ico {
                log_not_found off;
                }
        }
    include /etc/nginx/conf.d/*;
}

安装PHP

sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum-config-manager --enable remi-php74
sudo yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-xml php-pear php-bcmath php-redis php-memcached php-ldap php-intl
systemctl start php-fpm
systemctl enable php-fpm

## 修改php配置
## vi /etc/php.ini
post_max_size = 512M;
upload_max_filesize = 512M;
memory_limit = 1024M;
max_execution_time = 3600;
max_input_time = 3600;
cgi.fix_pathinfo=1

## 修改php-fpm配置
## vi /etc/php-fpm.d/www.conf
user = nginx
group = nginx
listen = /var/run/php-fpm.sock
listen.owner = nginx
listen.group = nginx
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 10
pm.max_spare_servers = 35

安装MySQL

yum localinstall https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
yum install mysql-community-server
systemctl enable mysqld
systemctl start mysqld
systemctl status mysqld
grep 'temporary password' /var/log/mysqld.log  ##获取临时密码
mysql_secure_installation   ##根据提示步骤进行安全设置

mysql -uroot -p  ##连上数据库,单独创建kodbox数据库和账号
    CREATE DATABASE db_kodbox;
    grant all privileges on db_kodbox.* to 'user_kodbox'@'%' identified by 'your_password';
    flush privileges;

安装redis

yum-config-manager --enable remi
yum install redis
systemctl start redis
systemctl enable redis

配置KodBox

cd /var/www/html/
wget https://static.kodcloud.com/update/download/kodbox.1.24.zip
unzip kodbox.1.24.zip
chown -R nginx:nginx /var/www/html
chmod -R 755 /var/www/html
systemctl restart nginx 
systemctl restart php-fpm

## 设置防火墙
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
## 然后访问你的IP或域名,在kodbox安装页面填写数据库账号,完成kodbox初始化

安装Docker

1.安装环境

#安装docker
curl -sSL https://get.daocloud.io/docker | sh

# 安装docker-compose
curl -L https://get.daocloud.io/docker/compose/releases/download/v2.1.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

# 安装git
yum install -y git

2.docker-compose一键启动

git clone https://github.com/KodCloud-dev/docker.git kodbox
cd ./kodbox/compose/
#修改docker-compose.yaml,设置数据库root密码(MYSQL_ROOT_PASSWORD=密码)
vi docker-compose.yaml

#启动
docker-compose up -d

安装宝塔面板

宝塔面板支持多种系统安装,这里推荐使用CentOS 7.9部署

1.安装LNMP环境

  • nginx 1.16以上
  • php 7.0以上
  • MySQL 5.7
  • redis 4以上
首次安装出现的弹窗,建议勾选 nginxMySQLphp

LNMP环境图

为了更好体验建议安装Redis

redis环境图

PHP设置安装Redis扩展

redis扩展环境图

PHP开启shell_exec、exec函数

开启函数环境图

2 正式部署

  1. 下载kodbox.1.24版本,上传到服务器,新建kodbox目录并进入,解压至当前目录 下载kodbox图
  2. 创建kodbox站点,开始部署安装:
    • 添加站点,目录为可道云解压目录,选择创建数据库,然后提交; 添加站点例图
    • 访问站点,数据库用户名密码参考上一步设置; 环境检测例图 数据库配置图 账号设置图
  3. 完成以上步骤即部署完毕。
在线预览, cad在线预览, 在线流程图, office在线编辑, psd在线预览