新版 walle(2.*) 安装

2020年8月10日

系统:Debian GNU/Linux 9

安全:建议内网 ,公网做好安全防御  , 防火墙 ip 限制,非常规端口等

 

 

1 安装 MYSQL5.7  Or   MariaDB 10.3 以上

 

 

本次安装 MariaDB  10.5  

原文:https://downloads.mariadb.org/mariadb/repositories/#distro=Debian&distro_release=jessie--jessie&mirror=iweb&version=10.5

Here are the commands to run to add MariaDB to your system:

  1. sudo apt-get install software-properties-common
  2. sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
  3. sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mariadb.mirror.iweb.com/repo/10.5/debian jessie main'

Once the key is imported and the repository added you can install MariaDB with:

  1. sudo apt-get update
  2. sudo apt-get install mariadb-server

See Installing MariaDB .deb Files for more information.

You can also create a custom MariaDB sources.list file. To do so, copy and paste the following into a file under /etc/apt/sources.list.d/ (we suggest naming the file MariaDB.list or something similar), or add it to the bottom of your /etc/apt/sources.list file.

  1. # MariaDB 10.5 repository list - created 2020-08-10 07:51 UTC
  2. # http://downloads.mariadb.org/mariadb/repositories/
  3. deb [arch=amd64,i386] http://mariadb.mirror.iweb.com/repo/10.5/debian jessie main
  4. deb-src http://mariadb.mirror.iweb.com/repo/10.5/debian jessie main

2 安装必要软件  libmariadb-dev Git

apt-get   install  libmariadb-dev  git

3.Clone code

git clone https://github.com/meolu/walle-web.git

4.Nginx config

别忘了要重启nginx,注意标出可能需要改的地方

upstream webservers {
    server 0.0.0.0:5000 weight=1; # 负载设置
}

server {
    listen       80;
    server_name  walle.website.com; # 域名设置
    access_log   /usr/local/nginx/logs/walle.log main;
    index index.html index.htm; # 日志目录

    location / {
        try_files $uri $uri/ /index.html;
        add_header access-control-allow-origin *;
        root /walle-web/fe; # 前端代码已集成到walle-web,即walle-web/fe的绝对路径
    }

    location ^~ /api/ {
        add_header access-control-allow-origin *;
        proxy_pass      http://webservers;
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header    Origin        $host:$server_port;
        proxy_set_header    Referer       $host:$server_port;
    }

    location ^~ /socket.io/ {
        add_header access-control-allow-origin *;
        proxy_pass      http://webservers;
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header    Origin        $host:$server_port;
        proxy_set_header    Referer       $host:$server_port;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;

        # WebScoket Support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

5.Install

安装Python 2.7 + pip

sh admin.sh init

# 注意:安装mysqlclient失败,需要先安装libmysqlclient-dev(ubuntu)
# 注意:安装失败请指定python路径. mac 可能会有用anaconda的python,找到自己系统的python 2.7追加参数指定 -p /usr/bin/python2.7 即可
# vi admin.sh +20
# virtualenv --no-site-packages -p /usr/local/bin/python2.7 venv

6.Create DB and Config setting

@TODO 就是可能要修改的地方
DB setting:

mysql -uroot -p
create database walle
grant all privileges on walle.* to "walle"@"localhost" identified by "123123";

Config setting:

vi walle/config/settings_prod.py
SETTINGS = {
    "MYSQL_USER": "walle",
    "MYSQL_PASSWORD": "123123",
    "MYSQL_DATABASE": "walle",
    "MYSQL_ROOT_PASSWORD": "",
    "MYSQL_HOST": "127.0.0.1",
    "MYSQL_PORT": 3306,
}

7.Data Migration

sh admin.sh migration

8.Start

8.1 启动

sh admin.sh start

 

8.2 重启、升级、Migration

sh admin.sh restart # 重启
sh admin.sh upgrade # 升级walle,升级完需要重启walle服务。升级前最好 git stash 暂存本地修改,升级后git stash pop弹出暂存,然后重启服务。
sh admin.sh migration # Migration

 

9.开启walle 2.0之旅

恭喜你,大功告成!浏览器打开http://admin.walle-web.io(因nginx配置域名而定)。初始登录账号如下,开启你的walle 2.0之旅吧:)

超管:[email protected] \ Walle123
所有者:[email protected] \ Walle123
负责人:[email protected] \ Walle123
开发者:[email protected] \ Walle123
访客:[email protected] \ Walle123

原文 : https://walle-web.io/docs/2/installation.html

没有评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注