在Ubuntu 18.04系統上安裝ERPNext ERP

在Ubuntu 18.04系統上安裝ERPNext ERP

簡介

ERPNext是一個功能豐富的企業級ERP系統,使用Frappe框架編寫,一個Python和JavaScript的Web應用程式框架,具有:會計管理、庫存管理製造管理、客戶關係管理系統、銷售管理、採購管理、專案管理等特性。 ERPNext ERP系統適用於中小型企業,它配備了一個完善的Web介面,具有ERP系統的所有功能。

安裝起來可能比較麻煩,艱苦努力下我貌似是安裝成功了,但是Redis可能還是有些問題。

把安裝時遇到的這些坑寫出來給新朋友看看吧,畢竟坑挺多的 。

按我的理解 ,首先要理解這個系統的安裝邏輯,frappe(冰凍過的)是一個開源的框架平臺,在他至上可以做很多東西,

然後我們是要安裝erpnext,首先我們要安裝Frappe Framework(冰凍過的框架)這個就是frappe框架吧,

冰鎮的框架是什麼?

冰凍過的是一個完整的堆疊,之一,Python和Javascript編寫的web框架。 它是權力的框架ERPNext。 很一般,可以用於構建資料庫驅動的應用程式。

在這之上,要我們安裝bench(板凳),這是個工作台,然後在bench上可以創建網站和添加app(這裡的app就是指erpnext,也就是說對於bench來說erpnext就是個app而已,所以bench可能可以做很多事情)

以上即我所理解的邏輯,。 下面說安裝和坑,如果是在公司的話注意防火牆可能會攔截導致部分東西下載總是失敗

首選安裝ubuntu 然後更改源,ubuntu各版本更改原始程式碼不同,改錯了可能還不如不改。

我用的鏡像是 ubuntu-18.04.2-live-server-amd64.iso

阿裡雲Ubuntu 18.04源

作者:X_Determined
連結: jianshu.com/p/16502ed02
來源:簡書

 deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
 deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
 deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
 deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
 deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
 deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
 deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
 deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
 deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
 deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

如何更換源:
更換apt源:(先備份一下)

cd /etc/apt/
sudo cp sources.list sources.list.bak && sudo vim sources.list

刪除其中所有內容,替換成最上邊的源內容:(vim 下 刪除所有行 的命令 :1,$d )
然後執行
sudo apt update
sudo apt upgrade

源不改也建議更新下

更新:

sudo apt-get update

sudo apt-get upgrade

然後運行sudo reboot命令重新啟動系統。

Debian / Ubuntu

安裝 gitpythonredis

sudo apt install git python-dev redis-server

安裝MariaDB

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.ubuntu-tw.org/mirror/mariadb/repo/10.3/ubuntu xenial main'
sudo apt-get update
sudo apt-get install mariadb-server-10.3

在這個安裝會提示設置MySQL的根密碼。 如果你不提示,你需要自己初始化MySQL伺服器設置。 你可以通過執行命令:

mysql_secure_installation

記住:不提示密碼設置,也直接繼續運行。

你記住這個密碼非常重要,因為它會有用的。 你還需要MySQL資料庫開發檔。

sudo apt-get install libmysqlclient-dev

現在,編輯MariaDB配置檔。

sudo nano /etc/mysql/my.cnf

並添加這個配置

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

現在,就重新啟動mysql服務和你好好的

sudo service mysql restart

安裝MariaDB資料庫后,應該為erpnext使用者創建一個資料庫。

登入並建立Mysql資料庫:

$ mysql -u root -p

建立資料庫並授予使用者管理資料庫的所有權限:

MariaDB [(none)]> create user erpnext@localhost identified by 'password123';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> create database erpnext;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> grant all privileges on erpnext.* to 'erpnext'@'localhost' with grant option;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> q;

安裝節點

我們建議安裝節點使用nvm

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

nvm安裝之後,您可能不得不關閉終端,打開另一個。 現在運行以下命令安裝節點。

nvm install 8

在安裝驗證,通過運行:

node-v#outputv8.11.3

最後,安裝 yarn 使用npm

npm install -g yarn

安裝wkhtmltopdf

sudo apt-get install xvfb libfontconfig wkhtmltopdf

以上這個bench工作臺所需要的環境都搭建好了

在手動安裝下面是自動安裝(其實自動安裝可能很好用,我給他放上來,大家可以試試)

簡單的安裝(就是自動安裝)

  • 這是一個固執己見的設置,所以最好設置一個空白的伺服器上。
  • 在Ubuntu 16.04 +, CentOS 7 +, Debian 8 +
  • 你可能需要安裝Python 2.7(如在Ubuntu 16.04 +)通過運行apt-get install python-minimal
  • 你可能還需要安裝建設重要和python-setuptools通過運行apt-get install build-essential python-setuptools
  • 這個腳本將所需的安裝,安裝工作台和設置ERPNext網站
  • 冰鎮的管理員和密碼MariaDB(根)將被要求
  • MariaDB(根)的密碼 password 在一個新的伺服器
  • 然後,您可以登錄管理員管理員密碼
  • 如果你發現任何問題,上傳到論壇:https://discuss.erpnext.com

開啟終端,輸入:

1. 下載安裝文稿

Linux:

wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

2. 執行安裝文稿

如果你在一個新的伺服器和作為根用戶登錄,首先創建一個專門的用戶冰鎮的 和這個用戶裝備sudo的特權

adduser [frappe-user]
  usermod -aG sudo frappe

(這個使用者是很常見的名字 frappe ,但這帶來的缺點 排名非常高的駭客圈子裡試圖進入伺服器。 所以生產基地 強烈建議使用一個自定義使用者名更難猜)

使用,用戶標記創建一個使用者並安裝使用該使用者

python install.py --develop --user [frappe-user]

為開發人員設定:

sudo python install.py --develop

生產:

sudo python install.py --production --user [frappe-user]

下面是手動安裝的咯——————

手動安裝 安裝台

安裝上的非根使用者,(就是不能用root使用者建立工作臺)

建立使用者 erpnext(使用者名稱:erpnext)

創建

$ sudo useradd -m -s /bin/bash erpnext

設置密碼

$ passwd erpnext

給許可權

$ sudo usermod -aG sudo erpnext

切換到erpnext使用者

$ su - erpnext

安裝bench台

git clone https://github.com/frappe/bench bench-repo
pip install --user -e bench-repo

注意:請不要刪除板凳上目錄上面的命令將創建

2. 安裝台

安裝上的非根使用者,

git clone https://github.com/frappe/bench bench-repo
pip install --user -e bench-repo

注意:請不要刪除板凳上目錄上面的命令將創建

基本用法

創建一個新的台
init命令將創建一個長椅上目錄和冰鎮的框架 安裝。 它將被設置為定期備份和自動更新一次 一天。 (這裡可能會遇到問題後面有說原因)

bench init frappe-bench && cd frappe-bench
  • 添加一個網站
    冰凍過的應用程式是由冰凍過的網站,您必須創建至少一個 網站。 新網站命令允許你這樣做。 (site1.local是網站的位址)
bench new-site site1.local
  • 添加應用程式
    get-app命令獲取遠端冰凍過的應用程式從一個遠端git存儲庫和安裝它們。 例子:erpnext
bench get-app erpnext https://github.com/frappe/erpnext
  • 安裝應用程式
    你的新網站上安裝一個應用程式使用 install-app 命令。 (site1.local是網站的位址)
bench --site site1.local install-app erpnext
  • 開始上
    要開始使用板凳上,使用 bench start 命令
bench start
  • 登錄到冰凍飲料/ ERPNext,打開你的瀏覽器和去 [your-external-ip]:8000 ,可能localhost:8000
    默認的使用者名是"管理員",密碼是你設置當您創建新網站。

遇到的錯誤

Bench init frappe-bench 
过程中遇到错误

報錯訊息

error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
fatal: The remote end hung up unexpectedly MiB | 32.00 KiB/s
Writing objects: 100% (59722/59722), 157.57 MiB | 6.09 MiB/s, done.
Total 59722 (delta 4636), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
Everything up-to-date

解決:這是由於git預設緩存大小不足導致的,使用下面的命令增加緩存大小

$ git config --global http.postBuffer 2000000000

What do you think?

Written by marketer

談談ERP

乾貨| ERP系統選型必備,你的ERP系統選對了嗎?