웹사이트 검색

Ubuntu 20.04에 인보이스 닌자를 설치하는 방법


이 페이지에서

  1. 전제 조건
  2. 시작하기\n
  3. LAMP 서버 설치
  4. MariaDB 데이터베이스 구성
  5. 인보이스 닌자 설치
  6. Invoice Ninja용 Apache 구성
  7. 인보이스 닌자 액세스
  8. Lets Encrypt SSL로 인보이스 닌자 보호\n
  9. 결론

Invoice Ninja는 프리랜서 및 비즈니스를 위한 무료 오픈 소스 온라인 인보이스 발행 앱으로 결제 수락, 비용 추적, 제안서 생성 및 시간 작업을 도와줍니다. Freshbooks와 같은 상업 송장 응용 프로그램과 매우 유사한 자체 호스팅 송장 응용 프로그램입니다. 그것은 당신이 자신의 맞춤형 인보이스를 생성하고 몇 초 안에 온라인으로 보낼 수 있습니다.

Invoice Ninja는 중소기업에 매우 유용합니다. 안전하고 사용하기 쉬운 인보이스 발행 소프트웨어를 찾고 있다면 Invoice Ninja가 최선의 선택입니다.

이 튜토리얼에서는 Apache와 함께 Invoice Ninja를 설치하고 Ubuntu 20.04 서버에서 SSL을 암호화하는 방법을 보여줍니다.

전제 조건

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

시작하기

먼저 시스템 패키지를 최신 버전으로 업데이트하는 것이 좋습니다. 다음 명령을 실행하여 모든 패키지를 업데이트합니다.

apt-get update -y

모든 패키지가 업데이트되면 다음 명령을 사용하여 다른 필수 종속성을 설치합니다.

apt-get install software-properties-common apt-transport-https ca-certificates gnupg2 -y

모든 종속성이 설치되면 다음 단계로 진행할 수 있습니다.

램프 서버 설치

다음으로 시스템에 Apache, MariaDB 및 PHP를 설치해야 합니다. 먼저 다음 명령을 사용하여 Apache 및 MariaDB 패키지를 설치합니다.

apt-get install apache2 mariadb-server -y

두 패키지를 모두 설치한 후 시스템에 PHP 버전 7.2 및 기타 확장을 설치해야 합니다.

기본적으로 Ubuntu 20.04는 PHP 버전 7.4와 함께 제공됩니다. 따라서 시스템에 Ondrej 저장소를 추가해야 합니다.

다음 명령을 사용하여 PHP Ondrej 저장소를 추가할 수 있습니다.

add-apt-repository ppa:ondrej/php

리포지토리가 추가되면 다음 명령을 사용하여 PHP 및 기타 확장을 설치합니다.

apt-get install php7.2 libapache2-mod-php7.2 php-imagick php7.2-fpm php7.2-mysql php7.2-common php7.2-gd php7.2-json php7.2-curl php7.2-zip php7.2-xml php7.2-mbstring php7.2-bz2 php7.2-intl php7.2-gmp unzip -y

모든 패키지를 설치한 후 다음 명령을 사용하여 설치된 PHP 버전을 확인합니다.

php -v

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

PHP 7.2.34-8+ubuntu20.04.1+deb.sury.org+1 (cli) (built: Oct 31 2020 16:57:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.34-8+ubuntu20.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

MariaDB 데이터베이스 구성

다음으로 Invoice Ninja용 데이터베이스와 사용자를 생성해야 합니다. 먼저 다음 명령을 사용하여 MariaDB 콘솔에 로그인합니다.

mysql

로그인 후 다음 명령을 사용하여 데이터베이스와 사용자를 생성합니다.

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

그런 다음 다음 명령을 사용하여 invoicedb에 모든 권한을 부여합니다.

MariaDB [(none)]> grant all privileges on invoicedb.* to ;

그런 다음 권한을 플러시하고 다음 명령을 사용하여 MariaDB 콘솔을 종료합니다.

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

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

인보이스 닌자 설치

먼저 공식 웹 사이트에서 최신 버전의 Invoice Ninja를 다운로드합니다.

wget -O invoice-ninja.zip https://download.invoiceninja.com/

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

unzip invoice-ninja.zip -d /var/www/html/

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

chown -R www-data:www-data /var/www/html/ninja
chmod -R 755 /var/www/html/ninja

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

Invoice Ninja용 Apache 구성

다음으로 Invoice Ninja용 Apache 가상 호스트 구성 파일을 생성해야 합니다. 다음 명령으로 만들 수 있습니다.

nano /etc/apache2/sites-available/ninja.conf

다음 줄을 추가합니다.

<VirtualHost *:80>
    ServerName invoice.example.com
    DocumentRoot /var/www/html/ninja/public
    <Directory /var/www/html/ninja/public>
       DirectoryIndex index.php
       Options +FollowSymLinks
       AllowOverride All
       Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/invoice-ninja.error.log
    CustomLog ${APACHE_LOG_DIR}/invoice-ninja.access.log combined

    Include /etc/apache2/conf-available/php7.2-fpm.conf
</VirtualHost>

파일을 저장하고 닫은 후 다음 명령을 사용하여 가상 호스트 파일을 활성화합니다.

a2ensite ninja.conf

그런 다음 다음 명령을 사용하여 필수 아파치 모듈을 활성화합니다.

a2enmod mpm_event proxy_fcgi setenvif
a2enmod rewrite

마지막으로 Apache 서비스를 다시 시작하여 변경 사항을 적용합니다.

systemctl restart apache2

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

systemctl status apache2

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

? apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2020-12-27 07:15:15 UTC; 11s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 25097 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 25113 (apache2)
      Tasks: 55 (limit: 2353)
     Memory: 5.3M
     CGroup: /system.slice/apache2.service
             ??25113 /usr/sbin/apache2 -k start
             ??25114 /usr/sbin/apache2 -k start
             ??25115 /usr/sbin/apache2 -k start

Dec 27 07:15:15 ubuntu systemd[1]: Starting The Apache HTTP Server..

이 시점에서 Apache는 Invoice Ninja를 제공하도록 구성됩니다. 이제 다음 단계를 진행할 수 있습니다.

인보이스 닌자에 액세스

이제 웹 브라우저를 열고 URL http://invoice.example.com을 사용하여 Invoice Ninja에 액세스하십시오. 다음 페이지로 리디렉션됩니다.

웹사이트 URL, 데이터베이스 세부 정보, 관리자 사용자 이름, 암호를 제공하고 제출 버튼을 클릭합니다. Invoice Ninja 로그인 화면으로 리디렉션됩니다.

관리자 사용자 이름, 비밀번호를 제공하고 로그인 버튼을 클릭합니다. 다음 화면에 Invoice Ninja 대시보드가 표시되어야 합니다.

Lets Encrypt SSL로 안전한 인보이스 닌자

Lets Encrypt SSL로 웹 사이트를 보호하는 것은 항상 좋은 생각입니다. SSL을 설치하고 관리하려면 Certbot 클라이언트를 설치해야 합니다. 다음 명령으로 설치할 수 있습니다.

apt-get install python3-certbot-apache -y

Certbot이 설치되면 다음 명령을 실행하여 Lets Encrypt SSL로 웹 사이트를 보호하십시오.

certbot --apache -d invoice.example.com

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

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
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
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for invoice.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/invoice-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/invoice-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/invoice-le-ssl.conf

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

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 키를 눌러 웹사이트에 Lets Encrypt SSL을 설치합니다.

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/invoice.conf to ssl vhost in /etc/apache2/sites-available/invoice-le-ssl.conf

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/invoice.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/invoice.example.com/privkey.pem
   Your cert will expire on 2020-10-23. 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://invoice.example.com을 사용하여 안전하게 웹사이트에 액세스할 수 있습니다.

결론

축하합니다! Ubuntu 20.04 서버에서 Lets Encrypt SSL을 사용하여 Invoice Ninja를 성공적으로 설치하고 구성했습니다. 이제 Invoice Ninja에서 더 많은 기능을 탐색하고 프로덕션 환경에 배포할 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.