웹사이트 검색

Ubuntu의 소스 코드에서 ONLYOFFICE Document Server를 컴파일하는 방법


이 페이지에서

  1. 1단계: 종속성 설치
  2. 2단계: 문서 서버 소스 코드 빌드
  3. 3단계: NGINX, PostgreSQL 및 RabbitMQ 설치 및 구성
    1. 1. NGINX 설치 및 구성
    2. 2. PostgreSQL 설치 및 구성
    3. 3. RabbitMQ 설치
    4. 4단계: 글꼴 데이터 생성
    5. 5단계: 프레젠테이션 테마 생성\n
    6. 6단계: 문서 서버 실행\n

    ONLYOFFICE Document Server는 OOXML 형식(docx, xlsx, pptx)과의 높은 호환성을 제공하는 텍스트 문서, 스프레드시트 및 프레젠테이션을 위한 웹 기반 뷰어 및 공동 작업 편집기로 구성됩니다. 이 제품군은 GNU AGPL v3.0에 따라 배포됩니다.

    ONLYOFFICE Document Server는 Nextcloud, ownCloud, Seafile, HumHub, Plone 등과 같은 다양한 클라우드 스토리지 플랫폼과 통합될 수 있으며, 직접 구축하는 솔루션에도 통합될 수 있습니다. Document Server는 온라인 편집기 및 협업 플랫폼이 있는 무료 오픈 소스 솔루션인 ONLYOFFICE Community Edition의 일부로 사용할 수 있습니다.

    build_tools를 통해 사용자는 필요한 모든 구성 요소를 자동으로 설치하고 소스 코드에서 온라인 편집기의 최신 버전을 컴파일할 수 있습니다.

    이 자습서에서는 Ubuntu 설치(64비트 Ubuntu)용 ONLYOFFICE Document Server를 컴파일하는 방법을 배웁니다.

    시스템 요구 사항

    • CPU: 듀얼 코어 2GHz 이상
    • RAM: 2GB 이상
    • HDD: 최소 40GB의 여유 공간
    • 최소 4GB의 스왑

    1단계: 종속성 설치

    컴퓨터에 Python 및 Git이 설치되어 있지 않은 경우 다음 명령을 사용하여 설치합니다.

    sudo apt-get install -y python git

    2단계: 문서 서버 소스 코드 빌드

    build_tools 저장소를 복제합니다.

    git clone https://github.com/ONLYOFFICE/build_tools.git

    적절한 디렉토리로 이동합니다.

    cd build_tools/tools/linux

    스크립트를 실행합니다.

    ./automate.py server

    완료되면 빌드된 문서 서버는 ../../out/linux_64/onlyoffice/documentserver/ 디렉토리에서 사용할 수 있습니다.

    3단계: NGINX, PostgreSQL 및 RabbitMQ 설치 및 구성

    Document Server는 NGINX를 웹 서버로 사용하고 PostgreSQL을 데이터베이스로 사용합니다. 올바른 작업을 위해서는 RabbitMQ도 필요합니다.

    1. NGINX 설치 및 구성

    다음 명령으로 NGINX를 설치합니다.

    sudo apt-get install nginx

    기본 웹사이트 비활성화:

    sudo rm -f /etc/nginx/sites-enabled/default

    새 웹사이트를 설정합니다. 다음 데이터가 포함된 /etc/nginx/sites-available/onlyoffice-documentserver 파일을 생성합니다.

    map $http_host $this_host {
      "" $host;
      default $http_host;
    }
    map $http_x_forwarded_proto $the_scheme {
      default $http_x_forwarded_proto;
      "" $scheme;
    }
    map $http_x_forwarded_host $the_host {
      default $http_x_forwarded_host;
      "" $this_host;
    }
    map $http_upgrade $proxy_connection {
      default upgrade;
      "" close;
    }
    proxy_set_header Host $http_host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $proxy_connection;
    proxy_set_header X-Forwarded-Host $the_host;
    proxy_set_header X-Forwarded-Proto $the_scheme;
    server {
      listen 0.0.0.0:80;
      listen [::]:80 default_server;
      server_tokens off;
      rewrite ^\/OfficeWeb(\/apps\/.*)$ /web-apps$1 redirect;
      location / {
        proxy_pass http://localhost:8000;
        proxy_http_version 1.1;
      }
      location /spellchecker/ {
        proxy_pass http://localhost:8080/;
        proxy_http_version 1.1;
      }
    }

    /etc/nginx/sites-available 디렉토리에 새로 만든 웹사이트에 대한 심볼릭 링크를 추가합니다.

    sudo ln -s /etc/nginx/sites-available/onlyoffice-documentserver /etc/nginx/sites-enabled/onlyoffice-documentserver

    NGINX를 다시 시작합니다.

    sudo nginx -s reload

    2. PostgreSQL 설치 및 구성

    PostgreSQL 설치:

    sudo apt-get install postgresql

    PostgreSQL 데이터베이스 및 사용자를 생성합니다(사용자 및 암호 모두에 'onlyoffice' 입력).

    sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice;"
    sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
    sudo -i -u postgres psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"

    데이터베이스를 구성합니다.

    psql -hlocalhost -Uonlyoffice -d onlyoffice -f ../../out/linux_64/onlyoffice/documentserver/server/schema/postgresql/createdb.sql

    위의 명령은 한 줄입니다! onlyoffice PostgreSQL 사용자의 비밀번호를 입력하라는 메시지가 표시되면 'onlyoffice' 비밀번호를 입력하십시오.

    3. RabbitMQ 설치

    다음 명령을 사용하여 RabbitMQ를 설치합니다.

    sudo apt-get install rabbitmq-server

    4단계: 글꼴 데이터 생성

    다음 명령을 실행합니다.

    cd out/linux_64/onlyoffice/documentserver/
    mkdir fonts
    LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allfontsgen \
      --input="${PWD}/core-fonts" \
      --allfonts-web="${PWD}/sdkjs/common/AllFonts.js" \
      --allfonts="${PWD}/server/FileConverter/bin/AllFonts.js" \
      --images="${PWD}/sdkjs/common/Images" \
      --selection="${PWD}/server/FileConverter/bin/font_selection.bin" \
      --output-web='fonts' \
      --use-system="true"

    5단계: 프레젠테이션 테마 생성

    다음 명령을 실행합니다.

    cd out/linux_64/onlyoffice/documentserver/
    LD_LIBRARY_PATH=${PWD}/server/FileConverter/bin server/tools/allthemesgen \
      --converter-dir="${PWD}/server/FileConverter/bin"\
      --src="${PWD}/sdkjs/slide/themes"\
      --output="${PWD}/sdkjs/common/Images"

    6단계: 문서 서버 실행

    ONLYOFFICE 문서 서버의 모든 구성 요소는 포그라운드 프로세스로 실행됩니다. 터미널 콘솔을 실행하거나 백그라운드 모드에서 포그라운드 프로세스를 실행할 수 있는 특정 도구를 시작하려면 터미널 콘솔을 분리해야 합니다.

    FileConverter 서비스를 시작합니다.

    cd out/linux_64/onlyoffice/documentserver/server/FileConverter
    LD_LIBRARY_PATH=$PWD/bin NODE_ENV=development-linux NODE_CONFIG_DIR=$PWD/../Common/config ./converter

    SpellChecker 서비스를 시작합니다.

    cd out/linux_64/onlyoffice/documentserver/server/SpellChecker
    NODE_ENV=development-linux NODE_CONFIG_DIR=$PWD/../Common/config ./spellchecker

    DocService 서비스를 시작합니다.

    cd out/linux_64/onlyoffice/documentserver/server/DocService
    NODE_ENV=development-linux NODE_CONFIG_DIR=$PWD/../Common/config ./docservice

    그게 다야! 이제 소개에 설명된 ONLYOFFICE Document Server(온라인 편집기) 사용 방법 옵션 중 하나를 선택할 수 있습니다. 모든 클라우드 스토리지 서비스와 통합, 자체 솔루션에 통합 또는 ONLYOFFICE Community Server와 함께.