-
-
Save jaredmcateer/5698552 to your computer and use it in GitHub Desktop.
Revisions
-
jaredmcateer revised this gist
Jun 3, 2013 . 1 changed file with 3 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,12 +2,9 @@ base = ARGV[0] || '.' current_dir = File.expand_path(base) nginx_bin = `which nginx`.gsub("\n", '') fastcgi_bin = `which php5-fpm`.gsub("\n", '') db_bin = `which mysqld`.gsub("\n", '') procfile = <<PROCFILE web: #{nginx_bin} -p #{current_dir}/tmp/nginx/ -c ../../nginx.conf -
jaredmcateer revised this gist
Jun 3, 2013 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,12 @@ base = ARGV[0] || '.' current_dir = File.expand_path(base) nginx_bin = `which nginx` nginx_bin = nginx_bin.gsub('\n', '') fastcgi_bin = `which php5-fpm` fastcgi_bin = fastcgi_bin.gsub('\n', '') db_bin = `which mysqld` db_bin = db_bin.gsub('\n', '') procfile = <<PROCFILE web: #{nginx_bin} -p #{current_dir}/tmp/nginx/ -c ../../nginx.conf -
jaredmcateer revised this gist
Jun 3, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,9 @@ base = ARGV[0] || '.' current_dir = File.expand_path(base) nginx_bin = `which nginx`.gsub('\n', '') fastcgi_bin = `which php5-fpm`.gsub('\n', '') db_bin = `which mysqld`.gsub('\n', '') procfile = <<PROCFILE web: #{nginx_bin} -p #{current_dir}/tmp/nginx/ -c ../../nginx.conf -
jaredmcateer revised this gist
Jun 3, 2013 . 2 changed files with 6 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ # Install packages You should have homebrew version 0.9 or newer. This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,11 +2,14 @@ base = ARGV[0] || '.' current_dir = File.expand_path(base) nginx_bin = `which nginx` fastcgi_bin = `which php5-fpm` db_bin = `which mysqld` procfile = <<PROCFILE web: #{nginx_bin} -p #{current_dir}/tmp/nginx/ -c ../../nginx.conf fastcgi: #{fastcgi_bin} db: #{db_bin} PROCFILE nginx_conf = <<NGINX_CONF -
jaredmcateer revised this gist
Jun 3, 2013 . 2 changed files with 5 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ # Install packages You should have homebrew version 0.9 or newer. This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,18 @@ require 'fileutils' base = ARGV[0] || '.' current_dir = File.expand_path(base) procfile = <<PROCFILE web: `which nginx` -p #{current_dir}/tmp/nginx/ -c ../../nginx.conf fastcgi: `which php5-fpm` db: `which mysqld` PROCFILE nginx_conf = <<NGINX_CONF daemon off; http { include /etc/nginx/mime.types; default_type application/octet-stream; server { @@ -27,7 +26,7 @@ location ~ \.php$ { include /etc/nginx/fastcgi.conf; fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; } -
anderssvendal revised this gist
May 3, 2012 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Install packages You should have homebrew version 0.9 or newer. @@ -29,3 +31,12 @@ Change the root-path in `nginx.conf` logs access.log error.log # Setup script Use the `setup.rb` script to quickly prepare a new project. It creates the configuration files and skeleton folder structure. You can pass one parameter to the script, the name of the folder to use. Leave it empty to use the current directory. **Run it directly from this gist:** ruby -e "$(curl -fsSL https://raw.github.com/gist/2585743/d4d1fdb431724675ec2c6894a083c8af3872bb6f/setup.rb)" [optional folder name] -
anderssvendal revised this gist
May 3, 2012 . 1 changed file with 55 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,55 @@ require 'fileutils' base = ARGV[0] || '.' homebrew_path = `brew --prefix`.gsub(/\n/, '') current_dir = File.expand_path(base) procfile = <<PROCFILE web: #{homebrew_path}/sbin/nginx -p #{current_dir}/tmp/nginx/ -c ../../nginx.conf fastcgi: #{homebrew_path}/sbin/php-fpm db: #{homebrew_path}/bin/mysqld PROCFILE nginx_conf = <<NGINX_CONF daemon off; http { include #{homebrew_path}/etc/nginx/mime.types; default_type application/octet-stream; server { listen 3000; server_name localhost; root #{current_dir}/app; index index.php index.html; try_files $uri $uri/ /index.php?$args; location ~ \.php$ { include #{homebrew_path}/etc/nginx/fastcgi.conf; fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; } } } events { } NGINX_CONF # Create folder structure FileUtils.mkdir_p "#{base}/tmp/nginx/logs" FileUtils.mkdir "#{base}/app" # Create empty files FileUtils.touch "#{base}/tmp/nginx/logs/access.log" FileUtils.touch "#{base}/tmp/nginx/logs/error.log" # Create config files File.open("#{base}/Procfile", 'w') {|f| f.write(procfile) } File.open("#{base}/nginx.conf", 'w') {|f| f.write(nginx_conf) } # Create test php file File.open("#{base}/app/index.php", 'w') {|f| f.write("<?php\n echo '<h1>It works!</h1>';\n") } -
anderssvendal revised this gist
May 3, 2012 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -13,8 +13,11 @@ You should have homebrew version 0.9 or newer. brew tap josegonzalez/homebrew-php brew install php --with-mysql --with-fpm # Tweak config ## php-fpm To run php-fpm in the foreground set `deamonize = no` in the `php-fpm.conf`. Should be located in `/usr/local/Cellar/php/5.3.10/etc` ## nginx Change the root-path in `nginx.conf` # Folder structure Procfile -
anderssvendal created this gist
May 3, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ web: /usr/local/sbin/nginx -p `pwd`/tmp/nginx/ -c ../../nginx.conf fastcgi: /usr/local/sbin/php-fpm db: /usr/local/bin/mysqld This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ # Install packages You should have homebrew version 0.9 or newer. ## Install nginx brew install nginx ## Install mysql brew install mysql unset TMPDIR mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp ## Install php brew tap josegonzalez/homebrew-php brew install php --with-mysql --with-fpm # Tweak php-fpm config To run php-fpm in the foreground set `deamonize = no` in the php-fpm.conf. Should be located in `/usr/local/Cellar/php/5.3.10/etc` # Folder structure Procfile app <webapp goes here> nginx.conf tmp nginx logs access.log error.log This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ daemon off; http { include /usr/local/etc/nginx/mime.types; default_type application/octet-stream; server { listen 3000; server_name localhost; root <absolute path to document root>; index index.php index.html; try_files $uri $uri/ /index.php?$args; location ~ \.php$ { include /usr/local/etc/nginx/fastcgi.conf; fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; } } } events { }