2024年11月21日

HYEOS

随事而为

Debian11 Install frappe-bench+erpnext(v14)

2 min read

我的系统环境:

工控机:J1900 4CPU 4RAM 2X1000M网卡 DISK120G 操作系统:DEBIAN11

国内网络环境原因,部分地区需要走代理,pip安装包时报错需要配置更换国内源

终端/git走代理

export ALL_PROXY=socks5://username:password@ipadrees:port
git config --global http.proxy 'socks5://username:password@ipadrees:port'
git config --global https.proxy 'socks5://username:password@ipadrees:port'

另外,在bench init erpnext时出现git clone完成后报rpc tls错误,解决如下:

$sudo apt-get install gnutls-bin

$git config --global http.sslVerify false

$git config --global http.postBuffer 1048576000  //增大缓存

$ifconfig eth0 mtu 1400 // 把这个值改大点eth0是为网卡,根据自己的实际情况,enp2s0,enp3s0...

pip更换源

$cd ~
$mkdir .pip
$vim .pip/pip.conf
[global]
index-url = https://pypi.mirrors.ustc.edu.cn/simple/

[install]
trusted-host = pypi.mirrors.ustc.edu.cn

frappe-bench 安装

注意#root用户,$普通用户

#apt update && apt install build-essential git software-properties-common curl sudo screen

#apt install python3 python3-setuptools python3-dev python3-pip libffi-dev libssl-dev dirmngr

#apt install python3-distutils  wkhtmltopdf

#apt install virtualenv python3-venv python3.x-venv

$curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

$npm install -g yarn

$curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add –

$echo “deb https://dl.yarnpkg.com/debian/ stable main” | sudo tee /etc/apt/sources.list.d/yarn.list

$sudo apt-get update

#apt install redis-server

#systemctl enable –now redis-server.service

#apt install mariadb-server

#vim /etc/mysql/my.cnf //And add this configuration 
[mysqld] port = 3706 
character-set-client-handshake = FALSE 
character-set-server = utf8mb4 
collation-server = utf8mb4_unicode_ci 
[mysql] 
default-character-set = utf8mb4

#service mariadb restart

#mysql_secure_installation  //初始化数据库,设置ROOT密码 

#apt-get install mariadb-client

#apt install cron install nginx 

#apt install libxrender1 libxext6 xfonts-75dpi xfonts-base fontconfig libfontconfig  xvfb

$sudo pip3 install frappe-bench

#mkdier -p /work/frappe/

#chown -R  username /work/frappe

$cd /work/frappe
$bench init frappe-bench

//安装ERPNEXT应用//

安装步骤

1.  bench init erpnext

初始化frappe基础应用目录,erpnext需要基于frappe框架,所以在安装erpnext应用时,必须现进行frappe框架的初始化。 

2. cd erpnext

3. bench new-site erp.hyeos.net  // 创建一个site,用于容纳erpnext应用。
or 
bench new-site erp.hyeos.net --db-host hyeos.net --db-name erp --db-port 3706

4. 编辑Procfile及sites/common_site_config.json文件更改端口(如不需默认端口或被占用)

5. sudo bench setup production username //设置产品上线模式,启用生产环境

6. bench use erp.hyoes.net 设置默认网站目录
7. bench get-app erpnext https://github.com/frappe/erpnext.git

8. bench  install-app erpnext   //将erpnext应用安装道site下

9. bench --site erp.hyeos.net add-to-hosts  将erpnext.text域名绑定到本地。 

10.screen -S bench

11.bench start //启动应用。

//末//

bench config dns_multitenant on`

# installapp.sh

bench get-app erpnext https://github.com/frappe/erpnext.git

bench get-app https://github.com/frappe/bench_manager.git

bench get-app https://gitee.com/yuzelin/erpnext_chinese.git

bench get-app https://github.com/frappe/library_management

bench  install-app erpnext

bench build --app erpnext_chinese --force

bench  install-app erpnext_chinese  //汉化

bench  install-app bench_manager  //bench管理gui

bench install-app  library_management  //图书管理

发表回复

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