apache_conf Meteor项目的Amazon Elastic Beanstalk配置文件。该文件需要保存在r的.ebconfiguration /目录中
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf Meteor项目的Amazon Elastic Beanstalk配置文件。该文件需要保存在r的.ebconfiguration /目录中相关的知识,希望对你有一定的参考价值。
packages:
yum:
git: []
files:
/opt/elasticbeanstalk/hooks/appdeploy/pre/51install_meteor.sh:
mode: "000755"
user: root
group: root
encoding: plain
content: |
#!/usr/bin/env bash
echo !!! Setting up METEOR dependencies
export PATH=$PATH:/usr/local/bin
echo !!! Set PATH: $PATH
ln -s /opt/elasticbeanstalk/node-install/node-v0.8.21-linux-x64/bin/node /usr/local/bin/node
ln -s /opt/elasticbeanstalk/node-install/node-v0.8.21-linux-x64/bin/node-waf /usr/local/bin/node-waf
ln -s /opt/elasticbeanstalk/node-install/node-v0.8.21-linux-x64/bin/npm /usr/local/bin/npm
echo !!! Installing Meteor
export HOME=/home/ec2-user
curl https://install.meteor.com | sh
echo !!! Installing Meteorite
npm install -g meteorite
echo !!! Creating app bundle
cd /tmp/deployment/application
mrt bundle bundle.tgz
tar xfz bundle.tgz
rm -rf bundle.tgz
cd /usr/local/bin
rm mrt npm node-waf node
container_commands:
01_nginx_worker_processes:
command: "sed -i 's/^\s*\(worker_processes\s*\)\d*.*$/\14;/' /tmp/deployment/config/#etc#nginx#nginx.conf"
02_nginx_worker_rlimit:
command: "sed -i '/^\(\(\s*\)worker_processes\s*\)\d*.*$/a worker_rlimit_nofile 8192;' /tmp/deployment/config/#etc#nginx#nginx.conf"
03_nginx_worker_connections:
command: "sed -i 's/^\(\s*worker_connections\s*\)\d*.*$/\14096;/' /tmp/deployment/config/#etc#nginx#nginx.conf"
04_nginx_keepalive_timeout:
command: "sed 's/^\(\s*keepalive_timeout\s*\)\d*.*$/\130;/' /tmp/deployment/config/#etc#nginx#nginx.conf"
05_nginx_gzip:
command: |
sed '/upstream/i \
gzip on;\
gzip_comp_level 6;\
gzip_vary on;\
gzip_min_length 1000;\
gzip_proxied any;\
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;\
gzip_buffers 16 8k;\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf
06_nginx_static:
command: |
sed '/\s*location\s*\/.*/i \
location ~ ^/(images/|img/|javascript/|js/|css/|stylesheets/|font/|fonts/|flash/|media/|static/|robots.txt|humans.txt|favicon.ico) {\
root /var/app/current/bundle/static;\
access_log off;\
expires max;\
}\
\
location ~* \.(js|css)$ {\
root /var/app/current/bundle/static_cacheable;\
access_log off;\
expires max;\
}\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf
option_settings:
- option_name: ROOT_URL
value: http://pegleg.it
- option_name: MONGO_URL
value: mongodb://<user>:<password>@<mongo-server:port>/<db-name>
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: NodeCommand
value: node bundle/main.js
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: NodeVersion
value: 0.8.21
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: GzipCompression
value: true
以上是关于apache_conf Meteor项目的Amazon Elastic Beanstalk配置文件。该文件需要保存在r的.ebconfiguration /目录中的主要内容,如果未能解决你的问题,请参考以下文章
Meteor 项目部署至服务器(windows)
将 Meteor 项目部署到我自己的域?
Bluemix/CloudFoundry + Meteor - 如何重置项目?
Meteor cordova ios项目pch错误
如何组织 Meteor 项目中的文件夹和文件?
Meteor框架创建示例项目todos的问题