# install node
apt-get update
apt-get install git-core build-essential libssl-dev
cd /usr/src
git clone http://github.com/joyent/node.git
git checkout v0.6.7
cd node
./configure
make
make install
# install nginx
apt-get install nginx
vim /etc/nginx/sites-available/yourdomain
Setup nginx config
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:8000/;
proxy_redirect off;
}
}
Use Config
cd /etc/nginx/sites-enabled/
ln -s /etc/nginx/sites-available/yourdomain yourdomain
sudo /etc/init.d/nginx restart
ssh [email protected]
mkdir app.git
cd app.git
git init --bare
vim hooks/post-receive
Hook:
#!/bin/sh
GIT_WORK_TREE=/home/www/app git checkout -f
Setup
chmod +x hooks/post-receive