本文基于京东云,Ubuntu 20.04 ,系统安装
本文全程使用"FinalShell SSH" "Noepad++" 工具
一.使用ssh登录京东云 (不会自行度娘)
二.更换阿里源(防止因网络问题出错)
1.安全起见先备份原始源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
2.修改文件(位置:/etc/apt/sources.list)
2.打开sources.list文件,删除里面全部内容,
替换以下源
- deb http://mirrors.aliyun.com/ubuntu/ focal main restricted
- deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted
- deb http://mirrors.aliyun.com/ubuntu/ focal universe
- deb http://mirrors.aliyun.com/ubuntu/ focal-updates universe
- deb http://mirrors.aliyun.com/ubuntu/ focal multiverse
- deb http://mirrors.aliyun.com/ubuntu/ focal-updates multiverse
- deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
- deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted
- deb http://mirrors.aliyun.com/ubuntu/ focal-security universe
- deb http://mirrors.aliyun.com/ubuntu/ focal-security multiverse
修改后
保存上传服务器
三,更新Ubuntu系统
1.检查Ubuntu系统是否有更新
sudo apt update
2.升级Ubuntu系统
sudo apt upgrade
3.确认升级(输入Y)
更新速度看服务器的带宽
四.更新系统并且重启系统
apt update && apt upgrade -y && shutdown -r now
五.安装curl
sudo apt-get install curl
六.用curl下载node.js
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
七.安装erpnext v13 依赖
apt install -y nodejs mariadb-server-10.3 redis-server python3-pip nginx python3-testresources
八.修改数据库文件 (位置 /etc/mysql/my.cnf) 最后面添加以下内容
- [mysqld]
- character-set-client-handshake = FALSE
- character-set-server = utf8mb4
- collation-server = utf8mb4_unicode_ci
- [mysql]
- default-character-set = utf8mb4
九.重启数据库
service mysql restart
十.数据库安全配置(记住自己的数据库密码)
mysql_secure_installation
十一.数据库授权
mysql -u root -p
- USE mysql;
- UPDATE user SET plugin=' ' WHERE user ='root';
- FLUSH PRIVILEGES;
- exit;
十二.创建用户
adduser zhzy
授权(zhzy更换自己用户)
usermod -aG sudo zhzy
十三.切换刚创建的用户并进入根目录(zhzy更换自己用户)
su zhzy
cd ~
十四.当前用户 pip 更换国内源
mkdir ~/.pip
vim ~/.pip/pip.conf
- [global]
- timeout = 120
- index-url = https://mirrors.aliyun.com/pypi/simple/
- [install]
- trusted-host=mirrors.aliyun.com
十五.更改 root 用户的 pip 国内源(输入自己用户密码)
sudo mkdir /root/.pip
sudo cp ~/.pip/pip.conf /root/.pip
sudo apt install npm
npm config set registry https://registry.npm.taobao.org
十六.安装yarn
sudo npm install -g yarn
yarn config set registry https://registry.npm.taobao.org
查看安装版本
node -v && npm -v && python3 -V && pip3 -V && yarn -v
十七. 安装bench(输入下面两条命令)
pip3 install frappe-bench
sudo pip3 install frappe-bench
十八.重启系统
sudo reboot
十九.安装git
sudo apt install git
二十. 使用bench命令安装frappe框架 (此步骤时间长.耐心等待)一直无响应.输入rm -r hrf 删除之前 生成的目录 重新运行
su zhzy
cd ~
bench init --frappe-branch version-13 hrf --frappe-path=https://gitee.com/phipsoft/frappe
下面出现错误(别急)
系统会接着 下载
出现以下就差不多了
安装完成
rm -r hrf
输入2次y
二十一. 进入bench目录(hrf更换自己目录名)
cd hrf
二十二.创建站点(指定数据库创建站点)
bench new-site erpnext --verbose --db-name erpnext --db-host 127.0.0.1 --db-port 3306 --mariadb-root-username root --mariadb-root-password xxxx --admin-password admin --force
bench new-site erpnext 更换你的站点名
--db-name erpnext 更换自己数据库名
--mariadb-root-password xxxx 更换上面数据库的密码
--admin-password admin 更换自己站点管理密码
二十三.下载Erpnext
bench get-app --branch version-13 https://gitee.com/qinyanwan/erpnext
二十四.安装erpnext
bench install-app erpnext
二十五.supervisorctl管理.nginx作网页反向代理服务器(zhzy更换自己创建的用户名和用户密码)
sudo bench setup production zhzy
二十六.浏览器输入网站IP(恭喜你ERP架设完成)
以下为后续优化.
欢迎加入ERPNext中文QQ群641514022(大神聚集为你排忧解难)
一 .安装余老师汉化APP
bench get-app --branch master https://gitee.com/yuzelin/erpnext_chinese
bench install-app erpnext_chinese
联系客服