웹사이트 검색

Ubuntu 18.04 LTS에 Monica Personal Relationship Manager를 설치하는 방법


이 페이지에서

  1. 요구 사항\n
  2. 시작하기\n
  3. Nginx, MariaDB 및 PHP 설치
  4. MariaDB 구성
  5. Composer 및 Node.j 설치
  6. Monica 설치 및 구성
  7. 모니카용 Nginx 구성
  8. 모니카 액세스

Monica는 Laravel 프레임워크로 작성된 무료 오픈 소스 웹 기반 개인 관계 관리 소프트웨어입니다. 친구 및 가족에 대한 모든 중요한 세부 정보를 추적하는 데 사용됩니다. Monica를 사용하여 연락처를 쉽게 추가 및 관리하고, 연락처 간의 관계를 정의하고, 생일 자동 알림을 설정할 수 있습니다. Monica를 사용하여 소셜 미디어 또는 SMS에서 이루어진 대화를 추적할 수도 있습니다. Monica는 밀착 인화에 표시할 섹션을 정의할 수 있습니다.

이 튜토리얼에서는 Ubuntu 18.04 서버에 Monica PRM을 설치하는 방법을 배웁니다.

요구 사항

  • Ubuntu 18.04를 실행하는 서버.\n
  • 서버에 루트 암호가 설정되어 있습니다.\n

시작하기

먼저 시스템을 최신 버전으로 업데이트해야 합니다. 다음 명령으로 수행할 수 있습니다.

apt-get update -y
apt-get upgrade -y

시스템이 업데이트되면 시스템을 다시 시작하여 이러한 변경 사항을 적용하십시오.

Nginx, MariaDB 및 PHP 설치

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

apt-get install nginx mariadb-server php7.2 php7.2-cli php7.2-fpm php7.2-common php7.2-mbstring php7.2-xml php7.2-mysql php7.2-curl php7.2-zip php7.2-intl git wget unzip -y

모든 패키지가 설치되면 다음 단계로 진행할 수 있습니다.

MariaDB 구성

기본적으로 MariaDB 설치는 보안되지 않으므로 먼저 보안을 설정해야 합니다. 다음 명령으로 보안을 유지할 수 있습니다.

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

루트 암호를 입력하십시오. 그런 다음 다음 명령을 사용하여 Monica에 대한 데이터베이스 및 사용자를 생성합니다.

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

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

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

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

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

Composer 및 Node.j 설치

다음으로 Composer를 시스템에 설치해야 합니다. Composer는 PHP 프로그래밍 언어용 패키지 관리자입니다. PHP에서 필요한 모든 종속성을 설치하는 데 사용됩니다.

먼저 다음 명령을 사용하여 작성기 설치 프로그램을 다운로드합니다.

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

다음으로 스크립트 SHA-384 해시를 Composer 공개 키 페이지에 있는 최신 설치 프로그램 해시와 비교하여 스크립트의 데이터 무결성을 확인해야 합니다. 다음 명령으로 수행할 수 있습니다.

HASH="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

모든 것이 정상이면 다음 출력이 표시됩니다.

Installer verified

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

php composer-setup.php --install-dir=/usr/local/bin --filename=composer

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

All settings correct for using Composer
Downloading...

Composer (version 1.8.4) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

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

curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs

Monica 설치 및 구성

다음으로 Monica에 대한 디렉토리 구조를 생성해야 합니다. 다음 명령으로 이 작업을 수행할 수 있습니다.

mkdir -p /var/www/monica

다음으로 디렉터리를 monica로 변경하고 다음 명령을 사용하여 최신 버전의 Monica를 다운로드합니다.

cd /var/www/monica
git clone https://github.com/monicahq/monica.git .
git checkout tags/v2.1.1

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

Note: checking out 'tags/v2.1.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b 

HEAD is now at dcfd15fa Update translations (#1324)

다음으로 예제 환경 변수 파일의 이름을 바꿔야 합니다. 다음 명령으로 수행할 수 있습니다.

mv .env.example .env

다음으로 .env 파일을 열고 데이터베이스와 사용자 이름을 정의합니다.

nano .env

다음과 같이 변경합니다.

# Database information
# To keep this information secure, we urge you to change the default password
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
# You can use mysql unix socket if available, it overrides DB_HOST and DB_PORT values.
#DB_UNIX_SOCKET=/var/run/mysqld/mysqld.sock
DB_DATABASE=monica
DB_USERNAME=monica   
DB_PASSWORD=password

다음으로 다음 명령과 함께 Composer를 사용하여 필요한 모든 PHP 종속성을 설치합니다.

composer install --no-interaction --no-suggest --no-dev --ignore-platform-reqs

다음으로 다음 명령을 사용하여 모든 프런트 엔드 종속성을 설치합니다.

npm install

다음으로 다음 명령을 사용하여 JS 및 CSS를 컴파일합니다.

npm run production

다음으로 다음 명령을 사용하여 애플리케이션 키를 생성합니다.

php artisan key:generate

다음으로 다음 명령을 사용하여 데이터베이스를 마이그레이션하고 시드합니다.

php artisan setup:production

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

 You are about to setup and configure Monica. Do you wish to continue? (yes/no) [no]:
 > yes

 
-----------------------------
|
| Welcome to Monica v2.1.1
|
-----------------------------
| You can now register to the first account by opening the application:
| URL:      http://localhost
-----------------------------
Setup is done. Have fun.

그런 다음 다음 명령을 사용하여 monica 디렉토리에 적절한 권한을 제공하십시오.

chown -R www-data:www-data /var/www/monica

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

Monica용 Nginx 구성

다음으로 Monica용 Nginx 가상 호스트 파일을 생성해야 합니다. 다음 명령어를 사용하여 /etc/nginx/sites-available/ 디렉터리에 monica.conf 파일을 생성하면 됩니다.

nano /etc/nginx/sites-available/monica.conf

다음 줄을 추가합니다.

server {
    listen 80;
    listen [::]:80;

    server_name example.com;
    root /var/www/monica/public;

    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    }
}

파일을 저장하고 닫습니다. 그런 다음 다음 명령을 사용하여 Nginx 서비스를 다시 시작합니다.

systemctl restart nginx

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

systemctl status nginx

산출:

? nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2019-02-15 10:03:53 UTC; 2min 12s ago
     Docs: man:nginx(8)
  Process: 22598 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=killed, signal=TERM)
  Process: 22612 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 22601 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 22613 (nginx)
    Tasks: 2 (limit: 1114)
   CGroup: /system.slice/nginx.service
           ??22613 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           ??22615 nginx: worker process

Feb 15 10:03:53 ubuntu1804 systemd[1]: nginx.service: Failed with result 'timeout'.
Feb 15 10:03:53 ubuntu1804 systemd[1]: Stopped A high performance web server and a reverse proxy server.
Feb 15 10:03:53 ubuntu1804 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 15 10:03:53 ubuntu1804 systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 15 10:03:53 ubuntu1804 systemd[1]: Started A high performance web server and a reverse proxy server.

액세스 모니카

이제 Monica가 설치 및 구성되었습니다. Monica 웹 인터페이스에 액세스할 시간입니다.

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

이메일 주소, 이름 및 비밀번호를 제공하십시오. 그런 다음 등록 버튼을 클릭하십시오. 다음 페이지에 Monica 대시보드가 표시되어야 합니다.

축하합니다! Ubuntu 18.04 서버에 Monica를 성공적으로 설치했습니다. 이제 중앙 위치에서 Monica를 사용하여 연락처를 쉽게 관리할 수 있습니다. 질문이 있으시면 언제든지 저에게 물어보세요.