-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.txt
135 lines (72 loc) · 2.33 KB
/
commands.txt
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
SSH INTO VSI
$ ssh root@<ip address>
<---------- create user and switch from root ---------->
CREATE USER
$ adduser <choose username>
$ passwd <choose password>
ADD SUDO PRIVILEGES TO USER
$ usermod -aG wheel <chosen username>
SWITCH FROM ROOT TO USER
$ su - <username>
CHECK SUDO PRIVILEGES ARE PROPERLY ENABLED
$ sudo ls -la /root // only root or sudo can undertake this command
<---------- installing mongo ---------->
CREATE MONGODB REPO FILE
$ sudo vi /etc/yum.repos.d/mongodb-org.repo
ADD FOLLOWING TO FILE
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
CHECK MONGO REPO EXISTS
$ yum repolist
INSTALL MONDODB FROM REPO
$ sudo yum install mongodb-org
START MONGOD PROCESS
$ sudo systemctl start mongod
VERIFY MongoDB STARTED
$ sudo tail /var/log/mongodb/mongod.log
should see ' [listener] waiting for connections on port 27017 '
ENTER DB SERVER
$ mongo
CHECK ITS STATUS
$ systemctl is-enabled mongod; echo $?
STOP MONGOD PROCESS
$ sudo systemctl stop mongod
<---------- installing Git ---------->
INSTALL GIT
$ sudo yum install git
CHECK GIT VERSION
$ git --version
<---------- Clone Git Repo ---------->
GENERATE GITHUB KEY (ON SERVER)
$ ssh-keygen -t rsa
ADD THE KEY
$ ssh-add /home/<user>/.ssh/id_rsa_github // 'github' can be called anything
// ie. ' id_rsa_<anything here>'
LIKELY GET AUTH AGENT ERROR MESSAGE THEN TRY,
$ eval `ssh-agent -s`
then run the add key command again
$ ssh-add /home/<user>/.ssh/id_rsa_github
CLONE REPO
$ git clone [email protected]:<whatever the git repo name is>
<---------- install NodeJS ---------->
ADD NODESOURCE YUM REPOSITORY
$ curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
INSTALL NODEJS AND NPM
$ sudo yum install nodejs
to check install and version
$ node --version OR $ node -v
<---------- we need Yarn too ---------->
ADD YARN REPOSITORY
$ curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
IMPORT THE REPOSITORIES GPG KEY
$ sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg
INSTALL YARN
$ sudo yum install yarn
to check install and version
$ yarn --version OR $ yarn -v
**** THEN BUILD AND RUN REPO ****
DONE