-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
97 lines (81 loc) · 2.32 KB
/
init.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
#Start Up
BASE="$(cd "$(dirname "$0")"; pwd)"
#MYSQL Root Info
while [ -z "$mysql_password" ]; do
clear;
read -p "MYSQL Admin Password: " mysql_password;
read -p "Is this information correct [Y/n]: " mysql_correct;
if [ "$mysql_correct" == "n" ]; then
mysql_password=;
fi
done
#Update APT-GET
apt-get -y update
apt-get -y upgrade
apt-get -y install curl
apt-get -y install inotify-tools
apt-get -y install libssl-dev pkg-config build-essential curl gcc g++ checkinstall make
apt-get -y install ruby-dev libpq-dev
apt-get -y install python-software-properties
apt-get -y install software-properties-common
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get update
#Install FTP
sudo apt-get -y install vsftpd
cp $BASE/vsftpd.conf /etc/vsftpd.conf -fr
#Install Mysql
apt-get -y install mysql-server
mysql_install_db
mysql -u "root" -p "$mysql_password" -e "set global max_connections=10000;"
#Install Redis
apt-get -y install redis-server
cp $BASE/redis.conf /etc/redis/redis.conf
redis-server /etc/redis/redis.conf
#Install Node
apt-get -y install nodejs
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
echo "[ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh" >> /etc/profile
#Install Nodes Modules
npm install -g express forever standby
npm install -g csslint jslint jsonlint
npm install -g coffee-script pm2 pm2-web
#Install Dev-Proxy & Scout Realtime
if [ "$1" == "dev" ]; then
gem install scout_realtime;
scout_realtime start;
git clone [email protected]:Laborate/dev-proxy.git /root/dev-proxy;
bash /root/dev-proxy/init.sh;
fi
#Install Vim
apt-get -y remove vim-tiny
apt-get -y install vim
#Configure Firewall
apt-get -y install ufw
ufw disable
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow OpenSSH
ufw allow http
ufw allow ftp
if [ "$1" == "dev" ]; then
ufw allow 3000:3010/tcp
fi
ufw enable
#Configuring System Preferences
cp $BASE/sshd_config /etc/ssh/sshd_config -fr
cp $BASE/banner /etc/ssh/banner -fr
echo "clear; cat /etc/ssh/banner" >> /etc/profile;
#Configuring User Preferences
git config --global color.ui auto
git config --global core.editor "vim"
git config --global merge.tool vimdiff
export VISUAL=vim
export EDITOR=vim
#Clean Up
chmod -R 777 /var/spool/cron
chmod 751 /home
mkdir /home/archived_users/
rm -rf $BASE
shutdown -r 0
exit