We will install Larave 4.1 with PHP5.5 & Latest nginx on Ubuntu 12.04.3 x64.
apt-get update && apt-get upgrade
adduser [username]
usermod -aG sudo [username]
apt-get -y install git
# Note (November 2016): | |
# This config is rather outdated and left here for historical reasons, please refer to prerender.io for the latest setup information | |
# Serving static html to Googlebot is now considered bad practice as you should be using the escaped fragment crawling protocol | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name yourserver.com; | |
root /path/to/your/htdocs; |
# The upstream module is the link between Node.js and Nginx. | |
# Upstream is used for proxying requests to other servers. | |
# All requests for / get distributed between any of the servers listed. | |
upstream helloworld { | |
# Set up multiple Node.js webservers for load balancing. | |
# max_fails refers to number of failed attempts | |
# before server is considered inactive. | |
# weight priorities traffic to server. Ex. weight=2 will recieve | |
# twice as much traffic as server with weight=1 | |
server <your server ip>:3000 max_fails=0 fail_timeout=10s weight=1; |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
var app = angular.module('validationExample', []); | |
app.controller('signupController', ['$scope', function($scope) { | |
$scope.submitted = false; | |
$scope.signupForm = function() { | |
if ($scope.signup_form.$valid) { | |
} else { | |
$scope.signup_form.submitted = true; | |
} |
/*global angular: true, google: true, _ : true */ | |
'use strict'; | |
angular.module('geocoder', ['ngStorage']).factory('Geocoder', function ($localStorage, $q, $timeout) { | |
var locations = $localStorage.locations ? JSON.parse($localStorage.locations) : {}; | |
var queue = []; | |
// Amount of time (in milliseconds) to pause between each trip to the |
The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)
It does not balance, it leaves it to the kernel.
In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)
var http = require('http'), | |
_ = require('underscore'), | |
httpProxy = require('http-proxy'); | |
var proxyOptions = { | |
router: { | |
"api.testAppX.com" : 'localhost:2041', | |
"dev.api.testAppX.com" : 'localhost:2042', | |
"www.testAppY.com" : 'localhost:10520', | |
"test.oldApps.com" : 'localhost:10520', | |
'bc.ryanwu.co' : 'localhost:8888' |
module.exports = function (grunt) { | |
'use strict'; | |
// grunt-contrib-watchのlivereloadオプションでlivereload | |
grunt.initConfig({ | |
watch: { | |
html: { | |
files: '**/*.html', | |
tasks: [], |
Uses capped collection, tailable cursors and streams.