-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello.sh
106 lines (87 loc) · 2.78 KB
/
hello.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# chef나 puppet 같은거 쓰지 왜 이런거 쓰니ㅠㅠ
#
# 01. 일단 비밀 번호부터 바꾸자.
#
#passwd
#
# 02. Hostname 변경
#
# (hostname 확인은 그냥 보이지만) hostname
# echo "new hostname"> /proc/sys/kernel/hostname
# (추가하자, 다른 서버도 필요시)vi /etc/hosts
# vi /etc/sysconfig/network
# (재부팅) init 6
#
# 03. OS의 패키지 관리자로 필요 한 것을 설치하자.
#
ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')
if [ -f /etc/lsb-release ]; then
. /etc/lsb-release
OS=$DISTRIB_ID
VER=$DISTRIB_RELEASE
elif [ -f /etc/debian_version ]; then
OS=Debian # XXX or Ubuntu??
VER=$(cat /etc/debian_version)
echo "Ubuntu"
sudo sed -i -e 's/us.archive\.ubuntu\.com/ftp\.daum\.net/g' /etc/apt/sources.list
sudo sed -i -e 's/kr.archive\.ubuntu\.com/ftp\.daum\.net/g' /etc/apt/sources.list
<<<<<<< HEAD
sudo apt-get update
sudo apt-get upgrade -y;
sudo apt-get install git sysstat subversion -y
=======
sudo apt-get update;
sudo apt-get upgrade -y;
sudo apt-get install python-software-properties python g++ make -y;
#sudo apt-get install python-software-properties -y;
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update;
sudo apt-get install nodejs -y;
>>>>>>> 894db9073dae0d89275712cfa22ad6a5ade9a6de
elif [ -f /etc/redhat-release ]; then
# TODO add code for Red Hat and CentOS here
echo "CentOS"
yum update -y
yum install gcc-c++ gcc openssl-devel make git screen -y
echo -e "[mariadb]\nname = MariaDB\nbaseurl = http://yum.mariadb.org/5.5/centos5-x86\ngpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB\ngpgcheck=1" > /etc/yum.repos.d/MariaDB.repo
echo -e "[nginx]\nname=nginx repo\nbaseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/\ngpgcheck=0\nenabled=1" > /etc/yum.repos.d/nginx.repo
yum remove mysql-libs -y
yum install MariaDB-server MariaDB-client -y
else
OS=$(uname -s)
VER=$(uname -r)
fi
#
# node.js 는 컴파일 해서 설치 한다.
#
cd /usr/local/src/
wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
tar zxvf node-v0.10.26.tar.gz
cd node-v0.10.26
./configure
make -j
make install
node -v
npm -v
#npms
npm install -g forever
npm install -g express
#
# redis를 설치한다.
#
cd /usr/local/src
wget http://download.redis.io/releases/redis-2.8.3.tar.gz
tar xvfz redis-2.8.3.tar.gz
cd redis-2.8.3
make -j
make install
cd utils
./install_server.sh
/etc/init.d/redis_6379 start
#install vimrc screenrc
wget https://raw.github.com/hoyajigi/linuxtoys/master/vimrc
mv vimrc ~/.vimrc
#deploy
#forever start example.js to start a process.
#forever list to see list of all processes started by forever
#forever stop example.js to stop the process, or forever stop 0 to stop the process with index 0 (as shown by forever list).