Ubuntu18.04 安装ERPNEXT

text/plain 安装代码(1).txt — 4 KB

File contents

sudo apt-get update && sudo apt-get upgrade
sudo apt -y install python-minimal
sudo apt -y install git build-essential python-setuptools python-dev libffi-dev libssl-dev
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install --upgrade pip setuptools
sudo pip install ansible
sudo apt -y install curl
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 -y update && sudo apt -y install yarn
sudo apt -y install mariadb-server libmysqlclient-dev
sudo nano /etc/mysql/my.cnf

### 修改my.cnf 文件如下,复制粘贴在文件最后
[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4
###

sudo systemctl restart mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
sudo systemctl restart mysql


$ mysql -u root -p
CREATE USER erpnext@localhost IDENTIFIED BY 'Dv%1aX=(Ha68qazq';
CREATE DATABASE erpnext;
GRANT ALL ON erpnext.* TO 'erpnext'@'localhost' with grant option;
GRANT all privileges on *.* to 'root'@'localhost' IDENTIFIED BY 'Dv%1aX=(Ha68qazq' WITH GRANT OPTION;
FLUSH PRIVILEGES;
QUIT;



sudo curl --silent --location https://deb.nodesource.com/setup_8.x | sudo bash -
sudo apt -y install nginx nodejs redis-server
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl start redis-server
sudo systemctl enable redis-server
sudo apt -y install libxrender1 libxext6 xfonts-75dpi xfonts-base
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
sudo tar -xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -C /opt
sudo ln -s /opt/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
sudo ln -s /opt/wkhtmltox/bin/wkhtmltoimage /usr/bin/wkhtmltoimage
mkdir erpnext
cd erpnext/
sudo apt install virtualenv
virtualenv .
source ./bin/activate

cd
sudo useradd -m -s /bin/bash erpnext
sudo passwd erpnext
sudo usermod -aG sudo erpnext
$ sudo su - erpnext
$ vim ~/.bashrc
PATH=$PATH:~/.local/bin/
sudo mkdir /srv/bench
sudo chown -R erpnext /srv/bench
sudo su - erpnext
cd /srv/bench
git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo
bench init --frappe-branch master --frappe-path https://github.com/frappe/frappe.git frappe-bench


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

bench new-site testsite.com   
bench --site testsite.com install-app erpnext
bench start


#Setup Supervisor and Nginx
sudo apt -y install supervisor
sudo systemctl start supervisor
sudo systemctl enable supervisor
sudo bench setup production erpnext #你的用户名是erpnext不是bench
按两个y
chmod o+x /opt/bench/
#You can now access the site on:45.77.11.176或者erp.buyerclub.cn
#You can check the status of the processes by running.
sudo supervisorctl status all
#You should see the following output.

#bench@vultr:~/erpnext$ sudo supervisorctl status all
#erpnext-redis:erpnext-redis-cache                 RUNNING   pid 13852, uptime 0:00:54
#erpnext-redis:erpnext-redis-queue                 RUNNING   pid 13851, uptime 0:00:54
#erpnext-redis:erpnext-redis-socketio              RUNNING   pid 13853, uptime 0:00:54
#erpnext-web:erpnext-frappe-web                    RUNNING   pid 13856, uptime 0:00:54
#erpnext-web:erpnext-node-socketio                 RUNNING   pid 13855, uptime 0:00:54
#erpnext-workers:erpnext-frappe-default-worker-0   RUNNING   pid 13862, uptime 0:00:54
#erpnext-workers:erpnext-frappe-long-worker-0      RUNNING   pid 13870, uptime 0:00:54
#erpnext-workers:erpnext-frappe-schedule           RUNNING   pid 13869, uptime 0:00:54
#erpnext-workers:erpnext-frappe-short-worker-0     RUNNING   pid 13875, uptime 0:00:54
#To stop all of the ERPNext processes.

sudo supervisorctl stop all
#To start all the ERPNext processes.

sudo supervisorctl start all

#Setting Up SSL using Let's Encrypt
bench config dns_multitenant on
sudo bench setup lets-encrypt erp.buyerclub.cn
bench enable-scheduler