-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_clone.txt
201 lines (118 loc) · 4.79 KB
/
install_clone.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
Install From Clone:
1. Create a new linode.
2. Clone the linode from "CopyPasteServer"
a. Go to "CopyPasteServer"
b. Click on the "Clone" tab
c. Select the main profile, and select the disk images below.
d. Hit the "Select" button.
e. Select the newly built linode to clone to.
3. Once the clone has finished, boot the new linode.
4. Get the IP that this server uses.
a. Click the "Remote Access" tab.
b. Under "SSH Access" (and "Public IPs"), it should provide an IP that we can use to log in.
5. Assign the IP to the necessary domains.
a. Click on the "DNS Manager" tab.
b. Add a new domain zone if necessary.
c. Click on the domain to be edited.
6. Handle the necessary Sub-Domains
a. Click on the "DNS Manager" tab.
b. Click on the domain to be edited.
c. Click "Add a new A record"
d. In the "Hostname" field, add something like: "mysubdomain.domain.com" (or just "mysubdomain")
e. In the "IP Address" field, add the IP address that the domain used.
f. Note that these updates may take a while to propagate.
7. Log into the server
a. Load the Putty program.
b. Set the port to 43715
c. Load the uni6home SSH Key
d. Passphrase is "cJfo9FsoHmvK2Lsa"
8. Check for any updates that need to be made
apt-get clean
apt-get update
apt-get upgrade
apt-get dist-upgrade
9. Start important services
service nginx restart
service hhvm restart
service mysql restart
service postfix restart
service memcached restart
10. Update the MySQL Password
// Development: set the password to "ZFOYOpuap539qLNKdAmc37VBloj5pkYc9oiBDXdFplzeSI2AHkgim"
// Production: set the password to "1mA4aR5pgkYB4mc37Vn7zAJk4OmkI2AHloj5pkgiUHtapc3ERAPN9dAgaNDhuGeaiQj"
12. Setup SSH key access
// Create the SSH key in puttygen
// Use a passphrase, such as "cJfo9FsoHmvK2Lsa"
// Save the SSH key in a save location
// Load the SSH keys into the server
cd ~
mkdir .ssh
echo "" > .ssh/authorized_keys
chmod 700 .ssh
chmod 600 .ssh/authorized_keys
nano .ssh/authorized_keys
// Enter the appropriate ssh key into the file
service ssh restart
13. Test logging into the server with SSH.
// Load putty and see if the SSH key was successful.
14. Update important security settings.
cd /etc/ssh
nano sshd_config
// Change the port to 43715
// Change ChallengeResponseAuthentication to "no" (or create if it's not there)
// Change PasswordAuthentication to "no" (or create if it's not there)
// Change UsePAM to "no" (or create if it's not there)
service ssh restart
// Confirm that you can still log in
15. Install GIT on the server
apt-get install git
git config --global user.name "ServerName"
git config --global user.email [email protected]
// Now we're going to create the server's SSH key (for external connectsion, such as git)
cd ~/.ssh
ssh-keygen -t rsa -C "[email protected]"
// Now, copy the contents of id_rsa.pub
// Use the "-$" in the line so that it text-wraps.
// Note that you'll still have a line break or two and will have to remove those.
nano -$ id_rsa.pub
// Log into github.com
// Click on the gear (Settings) in the upper right corner.
// Click on "SSH Keys"
// Add the SSH key to your github account
// Check if your SSH key was added
ssh -T [email protected]
15. Create your git repository in github (if it doesn't exist yet)
16. Load the repository onto your localhost computer.
a. Open your git program (such as Github for Windows)
b. Clone the github repository into your localhost directory of choice.
c. Make any necessary commits.
16. Load the repostory onto the server.
// Go to the directory that you want to clone the repo at
// Example: cd /var/www
// Note: This will put it in /var/www/NAMEOFREPO
// List of potential git repositories
git clone [email protected]:tarsupin/system.git
git clone [email protected]:tarsupin/auth.git
// Run "git pull" in the appropriate directory (/var/www/NAMEOFREPO) to pull
git fetch --all && git reset --hard origin/master
// This will overwrite any changes, and won't interrupt any untracked files, such as user uploaded content.
15. Log into the server with FTP
a. Username: root
b. Password: tempRootUbUni1000MasterRoot
16. Upload the appropriate directories:
a. MUST ADD: /system
b. MUST ADD: /global-config.php
17. Set web permissions
chown www-data:www-data /var/www -R
18. Run the virtual host script
php /var/www/system/cli/vhost-script.php
19. Run the server installation script
php /var/www/system/cli/install-script.php
20. Update "global-config.php"
a. Set the environment to "development" or "production" (depending on your server used)
// Things to do
Check if user exists
if user doesn't exist, create it
update ssh settings
set virtual host for each site uploaded
upload a bunch of sites for this server