How to setup a VPS (or Dedicated Server) with Nginx from scratch

In this tutorial we are going to go through the steps of securing the server and configuring Nginx, PHP, Phpmyadmin and MySql.

Step 1. Basic Security

Assuming you have already logged into your server we start by changing the root password to something more secure.

passwd

 

This will prompt you to change the root password, It is recommended to choose something extremely complex as it is your most crucial line of defence against the outside world.

Next, open up the ssh config

vim /etc/ssh/sshd_config

and change the port from 22 to anything between 1025 to 65536, this will prevent our server from being easily spotted by malicious eyes (more…)