Enigma14 Web Server Provisioning

From EnigmaGuy Wiki
Revision as of 13:52, 14 June 2018 by Enigmaguy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Server hardware requirements

  • Ubuntu 18.04 Server LTS
  • AWS
  • 10 GB base HDD, 20 GB data HDD
  • 512 MB RAM

Server preparation

Allow sudo without password

  1. sudo -s
  2. visudo
  3. edit "%sudo ALL=NOPASSWD:ALL"

Set proxy if needed (on development environment)

  1. sudo -s
  2. vi /etc/environment

http_proxy="http://hostname:port/" https_proxy="http://hostname:port/"

List hard-drives on system

root@enigma14:~# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0    7:0    0 86.6M  1 loop /snap/core/4650
loop1    7:1    0 86.6M  1 loop /snap/core/4486
sda      8:0    0   10G  0 disk 
├─sda1   8:1    0    1M  0 part 
└─sda2   8:2    0   10G  0 part /
sdb      8:16   0 20.2G  0 disk <-- We will use this drive for data
sr0     11:0    1 1024M  0 rom  


Prepare hard-drive for data

root@enigma14:~# pvcreate /dev/sdb
 Physical volume "/dev/sdb" successfully created.
root@enigma14:~# vgcreate data /dev/sdb
 Volume group "data" successfully created
root@enigma14:~# lvcreate -L 10G --name /dev/data/docker-data
 Logical volume "docker-data" created.
root@enigma14:~# lvcreate -L 10G --name /dev/data/docker-images
 Logical volume "docker-images" created.
root@enigma14:~# lvs
 LV            VG   Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
 docker-data   data -wi-a----- 10.00g                                                    
 docker-images data -wi-a----- 10.00g                                                    
root@enigma14:~# lvdisplay 
 --- Logical volume ---
 LV Path                /dev/data/docker-data
 LV Name                docker-data
 VG Name                data
 LV UUID                2gU4TH-2nF1-Neeq-Yr99-pTyD-oOlA-aL9fgR
 LV Write Access        read/write
 LV Creation host, time enigma14, 2018-06-14 13:36:04 +0000
 LV Status              available
 # open                 0
 LV Size                10.00 GiB
 Current LE             2560
 Segments               1
 Allocation             inherit
 Read ahead sectors     auto
 - currently set to     256
 Block device           253:0
  
 --- Logical volume ---
 LV Path                /dev/data/docker-images
 LV Name                docker-images
 VG Name                data
 LV UUID                6kfdo9-s1Fw-LNCy-sC5Y-zpru-sCaz-syPUy9
 LV Write Access        read/write
 LV Creation host, time enigma14, 2018-06-14 13:36:12 +0000
 LV Status              available
 # open                 0
 LV Size                10.00 GiB
 Current LE             2560
 Segments               1
 Allocation             inherit
 Read ahead sectors     auto
 - currently set to     256
 Block device           253:1

Install basic packages

apt update
apt install vim python-pip git
pip install ansible