forked from cnodejs/nodeclub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
51 lines (39 loc) · 1.16 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# CentOS
## Config VPS
## Git
- `yum install git`
## NodeJS
- https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
~~~~~~
wget http://nodejs.tchol.org/repocfg/el/nodejs-stable-release.noarch.rpm
yum localinstall --nogpgcheck nodejs-stable-release.noarch.rpm
yum install nodejs-compat-symlinks npm
~~~~~~
- npm install ./
- npm install -g forever
- export NODE_ENV=production
- OR `$ NODE_ENV=production node app.js`
## MongoDB
- http://www.if-not-true-then-false.com/2010/install-mongodb-on-fedora-centos-red-hat-rhel/
- `bind_ip: 127.0.0.1` to config file
## IPTABLES
~~~~~~
`echo 1 > /proc/sys/net/ipv4/ip_forward`
`net.ipv4.ip_forward = 1` in `/etc/sysctl.conf`
~~~~~~
~~~~~~
### forward ports
### NOTICE :: SEEMS THE DST IP MUST BE PUBLIC IP/HOSTNAME RATHER THAN LOCALHOST
### EVEN BAD :: the to-port must be open in `filter` ???
*nat
-I PREROUTING -p tcp --dst 127.0.0.1 --dport 80 -j REDIRECT --to-port 8080
-I OUTPUT -p tcp --dst 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080
COMMIT
*filter
-A INPUT -p tcp --dport 25 -j ACCEPT
COMMIT
~~~~~~
~~~
iptables-restore < /etc/iptables.firewall.rules
service iptables restart
~~~