人财事物信息化 - ERPNext安装指南
甲、【Server】安装Frappe/ERPNext
Welcome to Ubuntu 22.04.5 LTS
- 在Ubuntu上创建新用户 #fr为[frappe-user]可自定义#
- 更新和升级包
- 安装python和setuptools以及开发环境
- 安装和设置MySql Server
- 编辑 MySql 配置文件
- 设置pip加速镜像(可略过)
- 安装node
- 设置NPM加速镜像(可略过)
- 安装 yarn
- 设置yarn加速镜像(可略过)
- 安装frappe-bench
- 初始化frappe-bench
- 将权限应用于用户目录
- 创建新站点
- 设置默认站点
- 安装ERPNext
- 设置生产环境
- 自定义会计科目表与多版本财务报表
sudo adduser fr
sudo usermod -a -G sudo fr
su fr
cd
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install git curl python3-dev python3-venv python3-setuptools python3-pip xvfb libfontconfig wkhtmltopdf libmysqlclient-dev redis-server mariadb-server mariadb-client software-properties-common python3-testresources cron nano -y
sudo mysql_secure_installation
* Enter your current password for root (enter for none):创建新站点时需要输入root password
* Switch to unix_socket authentication [Y/n] n
* Change the root password? [Y/n] Y
* Remove anonymous users? [Y/n] Y
* Disallow root login remotely? [Y/n] Y
* Remove test database and access to it? [Y/n] Y
* Reload privilege tables now? [Y/n]: Y
Thanks for using MariaDB!
sudo nano /etc/mysql/my.cnf
复制下面的部分并粘贴到您的配置文件中
[mysqld]按[ctrl]+[S]保存,再按[Ctrl]+[X]退出
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
pip config set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple
pip config set install.trusted-host mirrors.huaweicloud.com
sudo apt install nodejs
node -v
Expected version ">=18". Got "12.22.9"#如果版本报错,则按以下步骤重装:
sudo apt remove nodejs
sudo apt autoremove
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install nodejs -y
node -v
sudo apt install npm
sudo npm config set registry https://registry.npmmirror.com -g
sudo npm install -g yarn
yarn config set registry https://registry.npmmirror.com --global
sudo pip3 install frappe-bench --break-system-packages
bench init --frappe-branch version-15 french --frappe-path=https://gitee.com/feesow/frappe --verbose
cd french
sudo chmod -R o+rx /home/fr
bench new-site shudou
#shudou为[site-name]可自定义#
MySQL root password:#root password为第4步安装数据库时输入密码
Set Administrator password:
#初始化网站时管理员密码
bench use shudou
bench get-app --branch version-15 erpnext https://gitee.com/feesow/erpnext
bench install-app erpnext
sudo bench setup production fr
#建议用户名手工输入#
NOTE:如果报错,请参考文末doubao回复。
bench get-app accounting_cn https://gitee.com/feesow/accounting_cn
bench install-app accounting_cn
乙、【Browser】初始化配置
- 浏览器访问公网IP
- 登录网站管理员账号 用户名:administrator
- 切换语言为中文
- 创建用户
- 设置公司、会计科目表
- 设置您的系统……
- 设置完成,跳转主页
密码:(甲、14步)
甲、17 报错时的解决方法:
bench.exceptions.CommandFailedError: sudo /usr/bin/python3 -m pip install ansible
- 使用 apt 安装 ansible 要是你使用的是基于 Debian 或 Ubuntu 的系统,可借助 apt 来安装 ansible,这样能避免破坏系统的 Python 环境。
- 创建虚拟环境 你可以创建一个 Python 虚拟环境,然后在该环境中安装 ansible。
- 使用 pipx 安装 ansible pipx 能够在独立的虚拟环境中安装 Python 应用程序,防止破坏系统的 Python 环境。
sudo apt update
sudo apt install ansible
创建虚拟环境
python3 -m venv myenv
激活虚拟环境
source myenv/bin/activate
在虚拟环境中安装 ansible
pip install ansible
退出虚拟环境
deactivate
安装 pipx
sudo apt install pipx
pipx ensurepath
使用 pipx 安装 ansible
pipx install ansible
你可以按照自身需求挑选合适的方法来安装 ansible。