웹사이트 검색

Apache로 Akaunting을 설치하고 Ubuntu 22.04에서 SSL을 암호화하는 방법


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

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

이 페이지에서

  1. 전제 조건
  2. Apache, MariaDB 및 PHP 설치
  3. MariaDB 데이터베이스 구성
  4. Akaunting 설치
  5. Akaunting을 위한 Apache 구성\n
  6. Lets Encrypt SSL로 안전한 Akaunting\n
  7. Akaunting 웹 인터페이스 액세스
  8. 결론

Akaunting은 소기업 및 프리랜서를 위한 오픈 소스 및 자체 호스팅 회계 소프트웨어 애플리케이션입니다. Laravel, Bootstrap, jQuery 및 RESTful API를 사용하여 구축되었습니다. 웹 브라우저를 통해 송장, 견적 및 재무를 생성하고 관리하는 데 사용됩니다. 사용자와 개발자가 Akaunting의 기능을 확장할 수 있는 멋진 App Store를 제공합니다.

이 튜토리얼에서는 Ubuntu 22.04에서 Apache와 Lets Encrypt SSL을 사용하여 Akaunting 회계 소프트웨어를 설치하는 방법을 보여줍니다.

전제 조건

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

Apache, MariaDB 및 PHP 설치

먼저 서버에 Apache, MariaDB, PHP 및 기타 PHP 확장을 설치해야 합니다. 다음 명령을 실행하여 모두 설치할 수 있습니다.

apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-imap php-mbstring php-xmlrpc php-soap php-gd php-xml php-intl php-mysql php-cli php-bcmath php-ldap php-zip php-curl unzip curl -y

모든 패키지를 설치한 후 PHP 구성 파일을 편집하고 기본 설정을 변경합니다.

nano /etc/php/8.1/apache2/php.ini
Change the following lines:
memory_limit = 256M
upload_max_filesize = 16M
post_max_size = 16M
max_execution_time = 300
date.timezone = UTC

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

systemctl restart apache2

MariaDB 데이터베이스 구성

Akaunting은 MariaDB/MySQL을 데이터베이스 백엔드로 사용합니다. 따라서 Akaunting을 위한 데이터베이스와 사용자를 생성해야 합니다.

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

mysql

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

MariaDB [(none)]> CREATE DATABASE akaunting_db;
MariaDB [(none)]> CREATE USER 'akaunting_user'@'localhost' IDENTIFIED BY 'password';

다음으로 다음 명령을 사용하여 Akaunting 데이터베이스에 모든 권한을 부여합니다.

MariaDB [(none)]> GRANT ALL ON akaunting_db.* TO 'akaunting_user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

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

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Akaunting 설치

먼저 Akaunting 공식 다운로드 페이지로 이동하여 다음 명령어를 사용하여 최신 버전을 다운로드합니다.

wget -O Akaunting.zip https://akaunting.com/download.php?version=latest

다운로드가 완료되면 다운로드한 파일을 Apache 웹 루트 디렉터리에 압축을 풉니다.

mkdir -p /var/www/html/akaunting
unzip Akaunting.zip -d /var/www/html/akaunting

다음으로 Akaunting 디렉터리의 소유권과 권한을 변경합니다.

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

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

Akaunting을 위한 Apache 구성

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

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

다음 줄을 추가합니다.

<VirtualHost *:80>
ServerAdmin 
DocumentRoot /var/www/html/akaunting
ServerName akaunting.example.com
DirectoryIndex index.html index.php
<Directory /var/www/html/akaunting/>
Options +FollowSymlinks
AllowOverride All
Require all granted

</Directory>

ErrorLog ${APACHE_LOG_DIR}/akaunting_error.log
CustomLog ${APACHE_LOG_DIR}/akaunting_access.log combined

</VirtualHost>

파일을 저장하고 닫은 다음 Apache 가상 호스트를 활성화하고 다음 명령어를 사용하여 모듈을 다시 작성합니다.

a2ensite akaunting
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 Sat 2022-11-12 13:45:47 UTC; 10s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 16032 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 16036 (apache2)
      Tasks: 6 (limit: 464122)
     Memory: 14.2M
     CGroup: /system.slice/apache2.service
             ??16036 /usr/sbin/apache2 -k start
             ??16037 /usr/sbin/apache2 -k start
             ??16038 /usr/sbin/apache2 -k start
             ??16039 /usr/sbin/apache2 -k start
             ??16040 /usr/sbin/apache2 -k start
             ??16041 /usr/sbin/apache2 -k start

Nov 12 13:45:47 ubuntu22041 systemd[1]: Starting The Apache HTTP Server...

Lets Encrypt SSL로 안전한 Akaunting

다음으로 Lets Encrypt SSL로 웹 사이트를 보호하는 것이 좋습니다. 먼저 다음 명령을 사용하여 Certbot 클라이언트를 설치합니다.

apt-get install certbot python3-certbot-apache -y

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

certbot --apache -d akaunting.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 akaunting.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/akaunting-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/akaunting-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/akaunting-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/akaunting.conf to ssl vhost in /etc/apache2/sites-available/akaunting-le-ssl.conf

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/akaunting.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/akaunting.example.com/privkey.pem
   Your cert will expire on 2023-02-12. 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

Akaunting 웹 인터페이스에 액세스

이제 웹 브라우저를 열고 URL http://akaunting.example.com을 사용하여 Akaunting 웹 인터페이스에 액세스하십시오. 다음 화면이 표시됩니다.

언어를 선택하고 다음 버튼을 클릭합니다. 데이터베이스 구성 화면이 나타납니다.

데이터베이스 세부 정보를 제공하고 다음 버튼을 클릭합니다. 관리자 사용자 계정 생성 화면이 나타납니다.

회사 이름, 이메일, 비밀번호를 입력하고 다음 버튼을 클릭합니다. Akaunting 로그인 화면이 나타납니다.

관리자 사용자 이름, 암호를 제공하고 로그인 버튼을 클릭합니다. 다음 화면이 표시됩니다.

건너뛰기 버튼을 클릭합니다. 통화 화면이 나타납니다.

통화를 활성화하고 다음 버튼을 클릭합니다. 플러그인 화면이 표시됩니다.

필요한 모듈을 설치하고 다음 버튼을 클릭합니다. 다음 화면이 표시됩니다.

이제 위 화면에서 첫 번째 인보이스를 만들 수 있습니다.

결론

축하합니다! Apache와 함께 Akaunting을 성공적으로 설치했고 Ubuntu 22.04 서버에 Lets Encrypt SSL을 사용했습니다. 이제 조직에서 Akaunting 소프트웨어를 호스팅하여 어디서나 인보이스, 견적 및 재정을 관리할 수 있습니다. 궁금한 점이 있으면 언제든지 문의해 주세요.