수색…


시동 서비스

이 배포 가이드는 사용자가 Ubuntu 서버를 사용 중이며 자체 호스팅 중이거나 Amazon Web Services 또는 Rackspace와 같은 IaaS (Infrastructure as a Service) 제공자를 사용하고 있다고 가정합니다. Ubuntu 서버는 다른 응용 프로그램을 시작하기위한 데몬을 실행해야합니다.이 경우 Upstart 서비스를 권장합니다. Upstart에 대한 자세한 내용은 다음 링크를 참조하십시오.

Upstart - 시작하기
Ubuntu에서 Upstart 스크립트 시작하기
우분투 부츠 하우투
최신 Intro, 요리 책 및 우수 사례
Ubuntu Karmic에서 NodeJS를 서비스로 실행

서버에 파일 복사 및 빌드

Git 또는 GitHub를 사용하여 서버에 배포하는 것이 유리합니다. 이것은 기본적으로 서버에 로그인하여 앱을 실행하려는 디렉토리로 이동 한 다음 GitHub에서 직접 파일을 복제하는 것과 관련이 있습니다. 그런 다음 서버에 앱을 빌드합니다. 이 방법은 플랫폼 특정 파일이 올바르게 빌드되도록 보장하지만 Meteor가 서버 (500MB 이상)에 설치되어 있어야하며 서버가 약간 다를 경우 프로덕션 환경에서 약간 다른 빌드가 생성 될 수 있습니다.

cd /var/www
sudo git clone http://github.com/myaccount/myapp.git
cd /var/www/myapp
meteor build --directory ../myapp-production
sudo service myapp restart

번들 다음 서버로 복사

또는 응용 프로그램을 빌드 한 다음 배포 할 수도 있습니다.

cd myapp
meteor build --directory ../output
cd ..
scp output -r username@destination_host:/var/www/myapp-production

시작 스크립트 만들기

/etc/init/ directory upstart 스크립트가 필요합니다. .conf 끝나는 앱의 이름을 /etc/init/myapp.conf 와 같이 지정하십시오. 기본 신생 스크립트는 다음과 같습니다.

## /etc/init/myapp.conf
description "myapp.mydomain.com"
author      "[email protected]"

# Automatically Run on Startup
start on started mountall
stop on shutdown

# Automatically Respawn:
respawn
respawn limit 99 5

script
    export HOME="/root"
    export MONGO_URL='mongodb://myapp.compose.io:27017/meteor'
    export ROOT_URL='http://myapp.mydomain.com'
    export PORT='80'

    exec /usr/local/bin/node /var/www/myapp/main.js >> /var/log/myapp.log 2>&1
end script

복제 세트에 대한 시작 스크립트

복제 세트를 실행 중이거나 데이터베이스를 조각 낼 필요가있는 경우, 다음과 같은 시작 스크립트가 필요합니다.

# /etc/init/myapp.conf
description "myapp.mydomain.com"
author      "[email protected]"

# used to be: start on startup
# until we found some mounts weren't ready yet while booting:
start on started mountall
stop on shutdown

# Automatically Respawn:
respawn
respawn limit 99 5

script
    # upstart likes the $HOME variable to be specified
    export HOME="/root"

    # our example assumes you're using a replica set and/or oplog integreation
    export MONGO_URL='mongodb://mongo-a,mongo-b,mongo-c:27017/?replicaSet=meteor'

    # root_url and port are the other two important environment variables to set
    export ROOT_URL='http://myapp.mydomain.com'
    export PORT='80'

    exec /usr/local/bin/node /var/www/production/main.js >> /var/log/node.log 2>&1
end script

시작 스크립트 실행

마지막으로 Upstart 데몬을 시작하고 앱을 서비스로 초기화해야합니다.

sudo service myapp start

여러 개의 Meteor Apps를 호스팅하도록 서버 설정

https://www.phusionpassenger.com/
https://github.com/phusion/passenger
https://github.com/phusion/passenger/wiki/Phusion-Passenger:-Meteor-tutorial#wiki-installing



Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow