Created
April 22, 2012 14:40
-
-
Save marekjelen/2464385 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env ruby | |
require 'erb' | |
result = ERB.new(File.read(File.expand_path('../nginx.template', __FILE__))).result(binding) | |
File.open(File.join(ENV['OPENSHIFT_TMP_DIR'], 'env', 'conf', 'nginx.conf'), 'w') do |file| | |
file.write(result) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
passenger_root <%= ENV['OPENSHIFT_TMP_DIR'] %>env/lib/ruby/gems/1.9.1/gems/passenger-3.0.12; | |
passenger_ruby <%= ENV['OPENSHIFT_TMP_DIR'] %>env/bin/ruby; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
server { | |
listen <%= ENV['OPENSHIFT_INTERNAL_IP'] %>:<%= ENV['OPENSHIFT_INTERNAL_PORT'] %>; | |
root <%= ENV['OPENSHIFT_REPO_DIR'] %>public; | |
passenger_enabled on; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DIR=${OPENSHIFT_TMP_DIR} | |
rm -rf ${OPENSHIFT_DATA_DIR}env | |
rm ${OPENSHIFT_DATA_DIR}env.tar.bz2 | |
mkdir ${OPENSHIFT_DATA_DIR}env | |
ln -s ${OPENSHIFT_DATA_DIR}env ${DIR}env | |
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
tar xf pcre-8.30.tar.gz | |
rm pcre-8.30.tar.gz | |
wget http://nginx.org/download/nginx-1.0.15.tar.gz | |
tar -xf nginx-1.0.15.tar.gz | |
rm nginx-1.0.15.tar.gz | |
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.bz2 | |
tar xf ruby-1.9.3-p125.tar.bz2 | |
rm ruby-1.9.3-p125.tar.bz2 | |
#wget ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz | |
#tar xf readline-6.2.tar.gz | |
#rm readline-6.2.tar.gz | |
# | |
#cd readline-6.2 | |
#./configure --prefix=${DIR}env | |
#make && make install | |
#cd .. | |
#rm -rf readline-6.2 | |
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz | |
tar xf yaml-0.1.4.tar.gz | |
rm yaml-0.1.4.tar.gz | |
cd yaml-0.1.4 | |
./configure --prefix=${DIR}env | |
make && make install | |
cd .. | |
rm -rf yaml-0.1.4 | |
cd ruby-1.9.3-p125 | |
./configure --prefix=${DIR}env --enable-load-relative --with-static-linked-ext --disable-shared --disable-install-doc --with-opt-dir=${DIR}env | |
make && make install | |
cd .. | |
./env/bin/gem update --no-ri --no-rdoc | |
./env/bin/gem install bundler --no-ri --no-rdoc | |
./env/bin/gem install passenger --no-ri --no-rdoc | |
./env/bin/passenger-install-nginx-module --auto --prefix=${DIR}env --nginx-source-dir=${DIR}nginx-1.0.15 --extra-configure-flags="--with-pcre=${DIR}pcre-8.30" | |
rm -rf ruby-1.9.3-p125 | |
rm -rf nginx-1.0.15 | |
rm -rf pcre-8.30 | |
tar -jcf env.tar.bz2 env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment