|
|
@@ -1,12 +1,30 @@
|
1
|
1
|
---
|
2
|
2
|
layout: post
|
3
|
3
|
title: "Digital Ocean Server Setup"
|
|
4
|
+date: 2015-09-10 20:34:46
|
|
5
|
+last_modified_at: 2015-12-04 19:05:00
|
|
6
|
+excerpt: "How to setup and configure a Ubuntu Linux droplet with Digital Ocean."
|
|
7
|
+categories: Guides
|
|
8
|
+tags: Linux
|
|
9
|
+image:
|
|
10
|
+ feature: archey-j1x-server.jpg
|
|
11
|
+ topPosition: 0px
|
|
12
|
+bgContrast: dark
|
|
13
|
+bgGradientOpacity: darker
|
|
14
|
+syntaxHighlighter: yes
|
|
15
|
+published: true
|
4
|
16
|
---
|
5
|
17
|
|
|
18
|
+The easiest way to create a webserver where you have root access is with a Digital Ocean Droplet. But configuring everthing everytime you create a new server is a dawnting task. This tutorial will condensate all the initial configurations of a basic server.
|
|
19
|
+
|
6
|
20
|
## Droplet Setup
|
7
|
21
|
|
8
|
22
|
This server is going to have a bit of load so I will use the *$10* droplet with **1GB Ram** and **30GB SSD Disk**. Use the **Ubuntu 14.04 x64** image. I choose *Ubuntu* because there is a lot of documentation for it, but probably *Debian* or *CentOS* would be a better choise as a linux distro for a web server.
|
9
|
23
|
|
|
24
|
+After creating the droplet, get the ip and password sent to your email and login as root user:
|
|
25
|
+
|
|
26
|
+ ssh root@192.168.0.1
|
|
27
|
+
|
10
|
28
|
## Create a new super user
|
11
|
29
|
|
12
|
30
|
Its a good practice to create a new super user account that uses commands with ```sudo``` instead of using the **root** account where all commands are executed with ```sudo``` by default.
|
|
|
@@ -28,13 +46,13 @@ Create a new folder for **SSH** keys and modify its permissions:
|
28
|
46
|
|
29
|
47
|
Now create a new file for your SSH key and paste your public key inside of it:
|
30
|
48
|
|
31
|
|
- nano .ssh/authorized_keys
|
|
49
|
+ sudo nano .ssh/authorized_keys
|
32
|
50
|
|
33
|
51
|
Press ```Ctrl + X``` to exit nano, then ```Y``` to save and then hit ```Enter```.
|
34
|
52
|
|
35
|
53
|
Now restrict the permissions of the file with your key:
|
36
|
54
|
|
37
|
|
- chmod 600 .ssh/authorized_keys
|
|
55
|
+ sudo chmod 600 .ssh/authorized_keys
|
38
|
56
|
|
39
|
57
|
After everything is done, go back to being the root user:
|
40
|
58
|
|
|
|
@@ -93,8 +111,8 @@ For droplets with a low amount of RAM memory, its possible to increase the **SWA
|
93
|
111
|
|
94
|
112
|
To install zshell and set it as your default shell:
|
95
|
113
|
|
96
|
|
- apt-get install zsh
|
97
|
|
- apt-get install git-core
|
|
114
|
+ sudo apt-get install zsh
|
|
115
|
+ sudo apt-get install git-core
|
98
|
116
|
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
|
99
|
117
|
chsh -s `which zsh`
|
100
|
118
|
|
|
|
@@ -102,12 +120,11 @@ After installing **zshell**, exit the *ssh session* and log back in.
|
102
|
120
|
|
103
|
121
|
## Install slap
|
104
|
122
|
|
105
|
|
- sudo apt-get remove --purge node
|
106
|
|
- sudo npm cache clean
|
107
|
123
|
sudo apt-get install build-essential
|
108
|
124
|
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
|
109
|
125
|
sudo apt-get install -y nodejs
|
110
|
|
- sudo ln -s /usr/bin/nodejs /usr/bin/node
|
|
126
|
+ npm install -g node-gyp
|
|
127
|
+ npm install slap -g
|
111
|
128
|
|
112
|
129
|
## Change hostname
|
113
|
130
|
|
|
|
@@ -122,6 +139,7 @@ To install run:
|
122
|
139
|
sudo apt-get install lsb-release scrot
|
123
|
140
|
wget http://github.com/downloads/djmelik/archey/archey-0.2.8.deb
|
124
|
141
|
sudo dpkg -i archey-0.2.8.deb
|
|
142
|
+ archey
|
125
|
143
|
|
126
|
144
|
To use, just run the command ```archey```.
|
127
|
145
|
|