웹사이트 검색

Ubuntu 22.04에 ERPNext를 설치하는 방법


이 튜토리얼은 다음 OS 버전에 대해 존재합니다.

  • Ubuntu 22.04(Jammy Jellyfish)
  • Ubuntu 18.04(Bionic Beaver)

이 페이지에서

  1. 전제 조건
  2. 시작하기\n
  3. MariaDB 데이터베이스 설치 및 구성
  4. Ubuntu 22.04에 ERPNext 설치
  5. 생산 환경을 위한 ERPNext 구성\n
  6. ERPNext 웹 UI 액세스
  7. Lets Encrypt SSL로 안전한 ERPNext\n
  8. 결론

ERPNext는 제조업체, 유통업체 및 서비스에서 사용하는 무료 오픈 소스 ERP 소프트웨어입니다. Python, JavaScript 및 Frappe Framework로 구축되었습니다. 현대적이고 사용하기 쉬우며 무료이며 기업이 비즈니스 운영의 모든 측면을 관리하는 데 도움이 되는 중소기업용으로 설계되었습니다. 전 세계 수천 개의 기업이 이를 사용하여 ERP 프로세스를 관리합니다. 제조, 유통, 소매, 거래, 서비스, 교육, 비영리 등을 지원하는 최고의 ERP 시스템 중 하나입니다.

이 튜토리얼에서는 Ubuntu 22.04 서버에 ERPNext 소프트웨어를 설치하는 방법을 보여줍니다. ;var slotId=div-gpt-ad-howtoforge_com-medrectangle-3-0;var ffid=1;var alS=1021%1000;var container=document.getElementById(slotId);container.style.width=100%;var ins=document.createElement(ins);ins.id=slotId+-asloaded;ins.className=adsbygoogle ezasloaded;ins.dataset.adClient=pid;ins.dataset.adChannel=cid;if(ffid==2){ins. 데이터 세트.fullWidthResponsive=true;}

전제 조건

  • Ubuntu 22.04를 실행하는 서버.\n
  • 유효한 도메인이 서버를 가리키고 있습니다.\n
  • 서버에 루트 암호가 구성되어 있습니다.\n

시작하기

먼저 시스템에 일부 Python 종속 항목을 설치해야 합니다. 다음 명령으로 모두 설치할 수 있습니다.

apt-get install python3-dev libffi-dev git python3-pip python3-testresources libssl-dev wkhtmltopdf gcc g++ make python3.10-venv -y

모든 Python 종속성이 설치되면 서버에 Node.js를 설치해야 합니다.

먼저 다음 명령을 사용하여 Node.js 리포지토리를 추가합니다.

curl -sL https://deb.nodesource.com/setup_16.x | bash -

다음으로 다음 명령을 사용하여 Node.js 및 Redis 서버를 설치합니다.

apt-get install nodejs redis-server -y

두 패키지가 모두 설치되면 다음 명령을 실행하여 Yarn 패키지를 설치합니다.

npm install -g yarn

완료되면 다음 단계로 진행할 수 있습니다.

MariaDB 데이터베이스 설치 및 구성

기본적으로 MariaDB는 Ubuntu 22.04 기본 리포지토리에서 사용할 수 있습니다. 다음 명령으로 설치할 수 있습니다.

apt-get install mariadb-server -y

설치가 완료되면 MariaDB를 보호하고 다음 명령을 사용하여 MariaDB 루트 암호를 설정합니다.

mysql_secure_installation

MariaDB 루트 암호를 설정하고 설치를 보호하려면 아래와 같이 모든 질문에 답하십시오.

Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:
Re-enter new password:
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

MariaDB가 보호되면 다음 명령을 사용하여 MariaDB 콘솔에 로그인합니다.

mysql -u root -p

다음으로 MariaDB Innodb 파일 형식을 Barracuda로 변경해야 합니다. /etc/mysql/mariadb.conf.d/50-server.cnf 파일을 편집하면 됩니다.

nano /etc/mysql/mariadb.conf.d/50-server.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

파일을 저장하고 닫은 다음 MariaDB 서비스를 다시 시작하여 변경 사항을 구현합니다.

systemctl restart mariadb

Ubuntu 22.04에 ERPNext 설치

먼저 다음 명령을 사용하여 ERPNext를 실행할 새 사용자를 만듭니다.

useradd -m -s /bin/bash erpnext

그런 다음 다음 명령을 사용하여 ERPNext의 비밀번호를 설정하십시오.

passwd erpnext

다음으로 다음 명령을 사용하여 ERPNext 사용자를 sudo 그룹에 추가합니다.

usermod -aG sudo erpnext

그런 다음 ERPNext 사용자로 로그인하고 다음 명령을 사용하여 환경 변수를 설정합니다.

su - erpnext
nano ~/.bashrc

다음 줄을 추가합니다.

PATH=$PATH:~/.local/bin/

파일을 저장한 후 다음 명령을 사용하여 환경 변수를 활성화합니다.

source ~/.bashrc

다음으로 다음 명령을 사용하여 ERPNext용 디렉터리를 생성합니다.

sudo mkdir /opt/bench

다음으로 소유권을 erpnext 사용자로 설정합니다.

sudo chown -R erpnext:erpnext /opt/bench

다음으로 디렉터리를 /opt/bench로 변경하고 Git Hub에서 벤치 리포지토리를 복제합니다.

cd /opt/bench
git clone https://github.com/frappe/bench bench-repo

다음으로 pip3 명령을 사용하여 벤치 저장소를 설치합니다.

pip3 install -e bench-repo

설치가 완료되면 다음 명령을 사용하여 frappe 프레임워크로 벤치 디렉토리를 초기화합니다.

bench init erpnext

다음 출력이 표시되어야 합니다.

? Built js/checkout.min.js
? Built js/dialog.min.js
? Built js/social.min.js
? Built js/web_form.min.js
? Built js/list.min.js
? Built js/chat.js
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade caniuse-lite browserslist`
? Built css/frappe-rtl.css
? Built css/printview.css
? Built js/bootstrap-4-web.min.js
? Built js/barcode_scanner.min.js
? Built css/list.min.css
? Built css/report.min.css
? Built frappe/css/email.css
? Built js/frappe-recorder.min.js
? Built js/desk.min.js
? Built css/frappe-chat-web.css
? Built js/frappe-web.min.js
? Built css/form.min.css
? Built css/web_form.css
? Built css/desk.min.css
? Built css/frappe-web-b4.css
? Built js/control.min.js
? Built js/form.min.js
? Built js/data_import_tools.min.js
? Built js/report.min.js
?  Done in 111.35s
Done in 113.33s.
SUCCESS: Bench erpnext initialized

다음으로 디렉터리를 erpnext로 변경하고 다음 명령을 사용하여 새 ERPNext 사이트를 만듭니다.

cd /opt/bench/erpnext
bench new-site erp.example.com

아래와 같이 MariaDB 루트 비밀번호와 관리자 비밀번호를 제공하라는 메시지가 표시됩니다.

MySQL root password: 

Installing frappe...
Updating DocTypes for frappe        : [========================================] 100%
Updating country info               : [========================================] 100%
Set Administrator password: 
Re-enter Administrator password: 
*** Scheduler is disabled ***
Current Site set to erp.example.com

이 시점에서 ERPNext가 시스템에 설치됩니다.

프로덕션 환경을 위한 ERPNext 구성

다음으로 ERPNext 프로세스를 관리하고 Nginx를 리버스 프록시로 구성하려면 Supervisor를 설치해야 합니다.

먼저 사용자를 ERPNext로 전환한 후 다음 명령을 사용하여 Supervisor 및 Nginx를 설치합니다.

su - erpnext
sudo apt-get install supervisor nginx -y

다음으로 다음 명령을 사용하여 frappe-bench를 설치합니다.

sudo pip3 install frappe-bench

다음으로 디렉터리를 /opt/bench/erpnext로 변경하고 다음 명령을 사용하여 프로덕션 환경에 대한 ERPNext를 설정합니다.

cd /opt/bench/erpnext
sudo /home/erpnext/.local/bin/bench setup production erpnext

ERPNext가 구성되면 다음 출력이 표시됩니다.

PLAY RECAP ************************************************************************************************************************************
localhost                  : ok=8    changed=4    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   

$ sudo systemctl restart supervisor
Port configuration list:

Site erp.example.com assigned port: 80
$ /usr/bin/supervisorctl reread
No config updates to processes
$ /usr/bin/supervisorctl update
$ sudo /usr/sbin/nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
$ sudo systemctl reload nginx

이 시점에서 ERPNext는 프로덕션 환경을 위해 Nginx로 구성됩니다.

ERPNext 웹 UI에 액세스

이제 웹 브라우저를 열고 URL http://erp.example.com을 입력하십시오. ERPNext 로그인 페이지로 리디렉션됩니다.

관리자로 사용자 이름과 이전에 설정한 비밀번호를 제공하고 로그인 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

원하는 언어, 국가, 시간대, 통화를 선택하고 다음 버튼을 클릭합니다. 다음 페이지가 표시됩니다.

이름, 이메일, 비밀번호를 입력하고 설정 완료 버튼을 클릭합니다. 다음 페이지에 ERPNext 대시보드가 표시됩니다.

Lets Encrypt SSL로 안전한 ERPNext

먼저 Lets Encrypt SSL을 설치하고 관리하려면 Certbot 클라이언트를 설치해야 합니다. 다음 명령으로 설치할 수 있습니다.

sudo apt-get install certbot python3-certbot-nginx -y

설치가 완료되면 다음 명령을 실행하여 도메인에 Lets Encrypt SSL을 설치하고 구성합니다.

sudo certbot --nginx -d erp.example.com

아래와 같이 이메일을 제공하고 서비스 약관에 동의하라는 메시지가 표시됩니다.

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for erp.example.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/conf.d/erpnext.conf

다음으로 아래와 같이 HTTP 트래픽을 HTTPS로 리디렉션할지 여부를 선택합니다.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

2를 입력하고 Enter 키를 눌러 프로세스를 완료합니다. 다음 출력이 표시되어야 합니다.

Redirecting all traffic on port 80 to ssl in /etc/nginx/conf.d/erpnext.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://erp.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=erp.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/erp.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/erp.example.com/privkey.pem
   Your cert will expire on 2022-09-11. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

 - We were unable to subscribe you the EFF mailing list because your
   e-mail address appears to be invalid. You can try again later by
   visiting https://act.eff.org.

이 시점에서 ERPNext 웹사이트는 Lets Encrypt SSL로 보호됩니다. 이제 HTTPS 프로토콜을 사용하여 안전하게 웹사이트에 액세스할 수 있습니다.

결론

축하합니다! Nginx와 함께 ERPNext를 성공적으로 설치했으며 Ubuntu 22.04에서 SSL을 암호화합니다. 궁금한 점이 있으면 언제든지 문의해 주세요. 자세한 내용은 ERPNext 문서 페이지를 참조하세요.