웹사이트 검색

CentOS 8에 WebERP를 설치하는 방법


이 페이지에서

  1. 전제 조건
  2. LAMP 서버 설치
  3. MariaDB 구성
  4. webERP 설치
  5. webERP용 Apache 구성
  6. Lets Encrypt SSL로 webERP 보안
  7. 방화벽 구성\n
  8. webERP 웹 인터페이스 액세스
  9. 결론

webERP는 무료 오픈 소스의 완전한 웹 기반 회계 및 비즈니스 관리 시스템입니다. webERP를 사용하려면 웹 브라우저와 PDF 리더만 있으면 됩니다. webERP를 사용하면 구매 주문, 웹 스토어, 제조, 판매, 총계정원장, 배송 등 많은 것을 관리할 수 있습니다. PHP로 작성되었으며 MariaDB를 데이터베이스 백엔드로 사용합니다. 이 튜토리얼은 Apache와 함께 webERP를 설치하는 방법과 CentOS 8에서 SSL을 암호화하도록 하는 방법을 보여줍니다.

전제 조건

  • CentOS 8을 실행하는 서버.\n
  • 서버 IP를 가리키는 유효한 도메인 이름입니다.\n
  • 루트 암호는 서버에서 구성됩니다.\n

램프 서버 설치

먼저 다음 명령을 사용하여 Apache, MariaDB, PHP 및 기타 PHP 확장을 설치합니다.

dnf install httpd mariadb-server php php-mysqli php-curl php-json php-cgi php-xmlrpc php-gd php-mbstring unzip -y

모든 패키지가 설치되면 Apache 및 MariaDB 서비스를 시작하고 다음 명령을 사용하여 시스템 재부팅 시 시작할 수 있도록 합니다.

systemctl start httpd mariadb
systemctl enable httpd mariadb

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

MariaDB 구성

다음으로 MariaDB 루트 암호를 설정하고 MariaDB 설치를 보호해야 합니다. 다음 명령으로 수행할 수 있습니다.

mysql_secure_installation

아래와 같이 모든 질문에 답하십시오.

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

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

그런 다음 다음 명령을 사용하여 MariaDB 셸에 로그인합니다.

mysql -u root -p

연결되면 다음 명령을 사용하여 webERP용 데이터베이스 및 사용자를 생성합니다.

MariaDB [(none)]> create database weberp;
MariaDB [(none)]> create user identified by 'password';

그런 다음 다음 명령을 사용하여 webERP 데이터베이스에 대한 모든 권한을 부여합니다.

MariaDB [(none)]> grant all privileges on weberp.* to  identified by 'password';

다음으로 다음 명령을 사용하여 권한을 플러시하고 MariaDB를 종료합니다.

MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

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

webERP 설치

먼저 다음 명령을 사용하여 최신 버전의 webERP를 다운로드합니다.

wget https://sourceforge.net/projects/web-erp/files/webERP_4.15.zip

다운로드가 완료되면 다음 명령을 사용하여 다운로드한 파일을 Apache 웹 루트 디렉터리에 추출합니다.

unzip webERP_4.15.zip -d /var/www/html

그런 다음 다음 명령을 사용하여 적절한 권한과 소유권을 설정합니다.

chown -R apache:apache /var/www/html/webERP
chmod -R 755 /var/www/html/webERP

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

webERP용 Apache 구성

다음으로 webERP를 호스트할 새 Apache 가상 호스트 구성 파일을 생성해야 합니다. 다음 명령을 사용하여 만들 수 있습니다.

nano /etc/httpd/conf.d/weberp.conf

다음 줄을 추가합니다.

<VirtualHost *:80> 
ServerAdmin 
DocumentRoot /var/www/html/webERP
ServerName weberp.example.com
<Directory /var/www/html/webERP/> 
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory> 
ErrorLog /var/log/httpd/weberp.org-error_log
CustomLog /var/log/httpd/weberp.org-access_log common
</VirtualHost> 

완료되면 파일을 저장하고 닫습니다. 다음으로 Apache 서비스를 다시 시작하여 변경 사항을 적용합니다.

systemctl restart httpd

이제 다음 명령을 사용하여 Apache의 상태를 확인합니다.

systemctl status httpd

다음과 같은 결과가 표시되어야 합니다.

? httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           ??php-fpm.conf
   Active: active (running) since Sat 2021-05-01 05:57:27 EDT; 13s ago
     Docs: man:httpd.service(8)
 Main PID: 4896 (httpd)
   Status: "Running, listening on: port 80"
    Tasks: 213 (limit: 25014)
   Memory: 24.8M
   CGroup: /system.slice/httpd.service
           ??4896 /usr/sbin/httpd -DFOREGROUND
           ??4898 /usr/sbin/httpd -DFOREGROUND
           ??4899 /usr/sbin/httpd -DFOREGROUND
           ??4900 /usr/sbin/httpd -DFOREGROUND
           ??4901 /usr/sbin/httpd -DFOREGROUND

May 01 05:57:27 centos8 systemd[1]: Stopped The Apache HTTP Server.
May 01 05:57:27 centos8 systemd[1]: Starting The Apache HTTP Server...

이 시점에서 Apache 웹 서버는 webERP를 호스팅하도록 구성됩니다. 이제 다음 단계를 진행할 수 있습니다.

Lets Encrypt SSL로 webERP 보호

다음으로 Lets Encrypt SSL for webERP를 설치하려면 Certbot 클라이언트를 설치해야 합니다. 다음 명령으로 설치할 수 있습니다.

dnf install letsencrypt python3-certbot-apache

그런 다음 다음 명령을 사용하여 도메인에 대한 SSL 인증서를 가져와 설치합니다.

certbot --apache -d weberp.example.com

이메일 주소를 제공하고 서비스 약관에 동의하라는 메시지가 표시됩니다.

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
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. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, 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
Account registered.
Requesting a certificate for weberp.example.com
Performing the following challenges:
http-01 challenge for weberp.example.com
Waiting for verification.
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/httpd/conf.d/weberp.conf
Redirecting all traffic on port 80 to ssl in /etc/httpd/conf.d/weberp.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://weberp.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subscribe to the EFF mailing list (email: ).


IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/weberp.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/weberp.example.com/privkey.pem
   Your certificate will expire on 2021-06-09. 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"
 - 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

이제 URL https://weberp.example.com을 사용하여 웹 사이트에 안전하게 액세스할 수 있습니다.

방화벽 구성

다음으로 방화벽을 통해 포트 80 및 443을 허용해야 합니다. 다음 명령으로 허용할 수 있습니다.

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https

다음으로 방화벽을 다시 로드하여 변경 사항을 적용합니다.

firewall-cmd --reload

webERP 웹 인터페이스에 액세스

이제 웹 브라우저를 열고 URL https://weberp.example.com을 사용하여 webERP 웹 인터페이스에 액세스하십시오. 다음 페이지가 표시됩니다.

언어를 선택하고 다음 단계를 클릭하십시오. 다음 페이지가 표시됩니다.

데이터베이스 이름, 사용자, 암호를 제공하고 다음 단계를 클릭하십시오. 다음 페이지가 표시됩니다.

회사 이름, 시간대, 관리자 사용자 이름, 비밀번호를 제공하고 설치 버튼을 클릭합니다. 설치가 완료되면 다음 페이지가 표시됩니다.

관리자 사용자 이름, 암호를 제공하고 로그인 버튼을 클릭합니다. webERP 대시보드로 리디렉션됩니다.

결론

축하합니다! Apache와 Lets Encrypt SSL을 CentOS 8에 성공적으로 설치했습니다. 이제 더 많은 기능을 위해 webERP를 탐색하고 프로덕션 환경에서 구현할 수 있습니다.