本文基于京東云,Ubuntu 20.04 ,系統(tǒng)安裝
本文全程使用"FinalShell SSH" "Noepad++" 工具
一.使用ssh登錄京東云 (不會(huì)自行度娘)
二.更換阿里源(防止因網(wǎng)絡(luò)問(wèn)題出錯(cuò))
1.安全起見(jiàn)先備份原始源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
2.修改文件(位置:/etc/apt/sources.list)
2.打開(kāi)sources.list文件,刪除里面全部?jī)?nèi)容,
替換以下源
- 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
修改后
保存上傳服務(wù)器
三,更新Ubuntu系統(tǒng)
1.檢查Ubuntu系統(tǒng)是否有更新
sudo apt update
2.升級(jí)Ubuntu系統(tǒng)
sudo apt upgrade
3.確認(rèn)升級(jí)(輸入Y)
更新速度看服務(wù)器的帶寬
四.更新系統(tǒng)并且重啟系統(tǒng)
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
八.修改數(shù)據(jù)庫(kù)文件 (位置 /etc/mysql/my.cnf) 最后面添加以下內(nèi)容
- [mysqld]
- character-set-client-handshake = FALSE
- character-set-server = utf8mb4
- collation-server = utf8mb4_unicode_ci
- [mysql]
- default-character-set = utf8mb4
九.重啟數(shù)據(jù)庫(kù)
service mysql restart
十.數(shù)據(jù)庫(kù)安全配置(記住自己的數(shù)據(jù)庫(kù)密碼)
mysql_secure_installation
十一.數(shù)據(jù)庫(kù)授權(quán)
mysql -u root -p
- USE mysql;
- UPDATE user SET plugin=' ' WHERE user ='root';
- FLUSH PRIVILEGES;
- exit;
十二.創(chuàng)建用戶
adduser zhzy
授權(quán)(zhzy更換自己用戶)
usermod -aG sudo zhzy
十三.切換剛創(chuàng)建的用戶并進(jìn)入根目錄(zhzy更換自己用戶)
su zhzy
cd ~
十四.當(dāng)前用戶 pip 更換國(guó)內(nèi)源
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 國(guó)內(nèi)源(輸入自己用戶密碼)
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
十八.重啟系統(tǒng)
sudo reboot
十九.安裝git
sudo apt install git
二十. 使用bench命令安裝frappe框架 (此步驟時(shí)間長(zhǎng).耐心等待)一直無(wú)響應(yīng).輸入rm -r hrf 刪除之前 生成的目錄 重新運(yùn)行
su zhzy
cd ~
bench init --frappe-branch version-13 hrf --frappe-path=https://gitee.com/phipsoft/frappe
下面出現(xiàn)錯(cuò)誤(別急)
系統(tǒng)會(huì)接著 下載
出現(xiàn)以下就差不多了
安裝完成
rm -r hrf
輸入2次y
二十一. 進(jìn)入bench目錄(hrf更換自己目錄名)
cd hrf
二十二.創(chuàng)建站點(diǎn)(指定數(shù)據(jù)庫(kù)創(chuàng)建站點(diǎn))
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 更換你的站點(diǎn)名
--db-name erpnext 更換自己數(shù)據(jù)庫(kù)名
--mariadb-root-password xxxx 更換上面數(shù)據(jù)庫(kù)的密碼
--admin-password admin 更換自己站點(diǎn)管理密碼
二十三.下載Erpnext
bench get-app --branch version-13 https://gitee.com/qinyanwan/erpnext
二十四.安裝erpnext
bench install-app erpnext
二十五.supervisorctl管理.nginx作網(wǎng)頁(yè)反向代理服務(wù)器(zhzy更換自己創(chuàng)建的用戶名和用戶密碼)
sudo bench setup production zhzy
二十六.瀏覽器輸入網(wǎng)站IP(恭喜你ERP架設(shè)完成)
以下為后續(xù)優(yōu)化.
歡迎加入ERPNext中文QQ群641514022(大神聚集為你排憂解難)
一 .安裝余老師漢化APP
bench get-app --branch master https://gitee.com/yuzelin/erpnext_chinese
bench install-app erpnext_chinese
聯(lián)系客服