Projekt

Allgemein

Profil

Aktionen

Setup erpnext14

# install Ubuntu Server
# German
# German no dead keys
# Ubuntu Server
# enp1s0:
# <static net>/<net>
# <static IP>
# <static gateway>
# <dns IP 1>,<dns IP 2>,<dns IP 3>
# -with LVM full disk
# <hostname>
# frappe <SecretPassword>
# Install openssh server
# Retrieve SSH key from Launchpad
# Do not allow password

sudo apt update
sudo apt full-upgrade
# unattended-upgrades.service

sudoedit /etc/hosts
# add line
# <static IP>   <hostname.domain>

sudo apt install etckeeper
sudo git config --global --edit
# name = root
# email = <hostname.domain>

# my personal prefrences
sudo apt install emacs-nox
export EDITOR=emacs

sudoedit /etc/inputrc
# "\e[5~": history-search-backward
# "\e[6~": history-search-forward

# setup core services
sudo apt install locate aptitude apticron fail2ban rkhunter chkrootkit
logwatch atop nmap arp-scan arping
# Postfix als Satellitensystem einrichten
# <hostname>.<domain>
# <smtp-relay>.<domain>

sudoedit /etc/aliases
#root:         noc@domain
#alert:        alert@domain
sudo newaliases

sudoedit /etc/postfix/generic
#root@<hostname>.<domain>         noc@domain
#frappe@<hostname>.<domain>       noc@domain

sudoedit /etc/postfix/main.cf
# smtp_generic_maps = hash:/etc/postfix/generic

sudo postmap /etc/postfix/generic

sudo apt install backup-manager
# /var/archives
# /etc /home/frappe /usr/local /var/backups

sudoedit /etc/ssh/sshd_config
#PermitRootLogin prohibit-password

sudoedit /etc/rkhunter.conf
# MAIL-ON-WARNING=alert
# ALLOW_SSH_ROOT_USER=prohibit-password
# SCRIPTWHITELIST=/usr/bin/lwp-request
# ALLOWHIDDENDIR=/etc/.git
# ALLOWHIDDENFILE=/etc/.gitignore
# ALLOWHIDDENFILE=/etc/.etckeeper
sudo rkhunter --propupd
sudo rkhunter --check --sk

# ERPnext
# based on https://discuss.erpnext.com/t/erpnext-14-installation-development-productions-ubuntu-server-22-04/92922

sudo ufw allow 22,25,143,80,443,3306,3022,8000/tcp
sudo ufw enable

sudo apt install python3-minimal build-essential python3-setuptools
sudo apt install python3-dev python3.10-dev python3-setuptools python3-
pip python3-distutils redis-server
sudo apt install python3.10-venv
sudo apt update

sudo apt install xvfb libfontconfig wkhtmltopdf

sudo passwd root

sudo apt install mariadb-server mariadb-client
sudo mysql_secure_installation
# pwd
# Switch to unix_socket authentication: Y
# Change the root password? [Y/n] y
# password: pwd
# 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

mysql -u root -p
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password;
SET PASSWORD = PASSWORD(‘pwd’);
FLUSH PRIVILEGES;
quit
rm .mysql_history

sudoedit /etc/mysql/mariadb.conf.d/90-erpnext.cnf
#[mysqld]
#character-set-client-handshake = FALSE
#character-set-server = utf8mb4
#collation-server = utf8mb4_unicode_ci

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

sudo reboot

# NODE JS & NPM
wget https://deb.nodesource.com/setup_16.x
less setup_16.x
# Wow... add someones key to be trusted by system apt to install nodejs :-/ not cool but lets just get done.
chmod +x setup_16.x
sudo -E setup_16.x
sudo apt install nodejs

cd
tee -a ~/.bashrc<<EOF
PATH=$PATH:~/.local/bin/
EOF
source ~/.bashrc

# BENCH DIRECTORY
sudo mkdir /home/bench
sudo chown -R frappe /home/bench
cd /home/bench
sudo npm install -g yarn

# FRAPPE
pip3 install frappe-bench
bench init frappe --verbose --frappe-branch v14.4.3 #https://github.com/frappe/frappe/tags
cd frappe
bench start

# SITE CREATION
cd /home/bench/frappe
bench new-site <hostname>.<domain>
bench use <hostname>.<domain>
bench migrate

backup and load into test-site

also have a look at: https://www.it-management-kirchberger.at/manuals-tutorials/server-centos-7/erpnext/todo.html

To create a staging site from a production site backup:

cd <frappe/erpnext Verzeichnis>
mkdir ~/backup/

bench --site prod.example.net set-maintenance-mode on
bench --site prod.example.net set-config pause_scheduler 1
bench --site prod.example.net backup --with-files --compress --backup-path ~/backup/ 
# notice: Database Public & Private from stdout
bench --site prod.example.net set-maintenance-mode off

restore into other Staging instance:

bench new-site staging.example.net
bench --site staging.example.net set-maintenance-mode on

bench --site staging.example.net restore ~/backup/YYYYMMDD_HHMMSS-prod.example.net-database.sql.gz
  --with-public-files  ~/backup/YYYYMMDD_HHMMSS-prod.example.net-files.tar.gz
  --with-private-files ~/backup/YYYYMMDD_HHMMSS-prod.example.net-private-files.tar.gz
  MySQL root password:

bench --site staging.example.net mute_emails true
bench --site staging.example.net set-maintenance-mode off
rm -r ~/backup/

Von Jeremias Keihsler vor etwa 1 Jahr aktualisiert · 4 Revisionen