Development environment on Kimsufi instance, part 1
Setting up Ubuntu 16.04 on Kimsufi KS-4A with nginx, PHP & GitLab
Published Oct 17, 2017
Setting up Ubuntu 16.04 (Ubuntu 17.04)
Previous step
Configure your instance to have Ubuntu 16.04 fresh installed. Then connect through SSH to your instance (credentials given by mail after OS installation.)
Adding a sudo-able user
-
Create the new user by executing and fill the configuration :
root@your-instance:~# adduser username
-
Add the user to the
sudoers
:root@your-instance:~# adduser username sudo
-
(optionnal) Prevent the new user to type his email when he wants to switch to
root
root@your-instance:~# echo 'username ALL=NOPASSWD: ALL' >> /etc/sudoers
-
Try to connect with your username then try to switch to
root
username@your-instance:~$ sudo su - # Type your password if you need to (if you pass step 3) # You should see root@your-instance:~#
Next steps will use SSH through username
.
Packages installation
Keep yourself updated : sudo apt-get update
and sudo apt-get upgrade
(you should see nothing because fresh install keeps updated).
ufw (Uncomplicated Firewall)
- Install package :
sudo apt-get install ufw
-
Check available connections :
sudo ufw app list
, which should render :Available applications: Bind9 OpenSSH
- Add OpenSSH (obviously) by executing
sudo ufw allow OpenSSH
- Enable the firewall
sudo ufw enable
-
Check configuration
sudo ufw status
, which should render :Status: active To Action From -- ------ ---- OpenSSH ALLOW Anywhere OpenSSH (v6) ALLOW Anywhere (v6)
Install nginx
-
Install packages :
sudo apt-get install nginx
- Allow connection with ufw (nginx expose 3 services to ufw : HTTP, HTTPS, both) :
sudo ufw allow "Nginx HTTP"
- Reload the firewall :
sudo ufw reload
-
Check the status :
sudo ufw status
which should render :Status: active To Action From -- ------ ---- OpenSSH ALLOW Anywhere Nginx HTTP ALLOW Anywhere OpenSSH (v6) ALLOW Anywhere (v6) Nginx HTTP (v6) ALLOW Anywhere (v6)
-
Access your web server with your favorite browser : http://your-instance/, which should render :