Linux and Windows Services
Tags: linux, nginx
Published: 2021-04-25 05:53:19

The first service to add to your Linux box is the yum(Yellowdog Updater, Modified.)  It is the package management utility that is super useful on modern linux.  It is useful in newer cases for now we will be using APT(Advanced Package Tool)

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghu3qkxuvlyknzos5hb8.png)
 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/atui0lmuv73jxoi5ne9i.png)
 
Other services we will be exploring here are Apache web server and Nginx.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3my2igpecs07urk61vpc.png)
 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kqlt8qm1hvvxzc51n0hw.png)
 
After installing, we can check its status on the system.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aopbdkgoheapzlunu04c.png)
We can start and stop it with the same commands.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v49p9rs4or67qxps1xg8.png)
Similar command structure works for apache.

For Security reasons, you should replace your VSFTPd with a SFTP service.  SFTP does not actually use ftp protocol, it uses ssh services and emulates the ftp process.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4x0130xvvn3eum1ttegc.png)
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7c1au9dlr40j9eujn4px.png)
 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5hili6q9rowafiyx0vsq.png)

 We, of course, need to set up open ssh on our server to make this work for us.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/25d8l5cuyuhb7yuosjjg.png)

Also, edit the ssh_config file by adding the last 5 lines to the file.
sudo nano /etc/ssh/ssh_config
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zzpe9btjv3ncz195tsfx.png)
You can set up a new user to connect to the sftp service.
 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xjyqfcxxvpfhtofghrk.png)
 Connecting to the service is similar to this:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pcwn6bquflg72gszilae.png)
Make sure to change the ip to your needs.

 We can secure our Nginx service in our firewall with the ufw commands.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t4tj3izd3habxxexxyle.png)
 
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lw8fl0duqr6q090xd3c5.png)
 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4c2p3tr49xa6v36yqnzb.png)
 Your UFW can be configured by port number and IP address.  This will by default configure for IPv6 if you are just doing ports.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50lwogdoykcy55g10zgw.png)
 You can turn off IPv6 by going into /etc/default/ufw :
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ix3j4m5scyms6j9ybvdg.png)
 Windows Server is, as always, doing its own thing for web servers.  They use IIS.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4fcbjoywow6yewnyyyie.png)
 The Easy Way to install IIS is to go through Server Manager and pick the IIS role.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x1mtuxpfo9ejgc5qbip8.png)
You might need to install Windows Authentication for the service to use instead of Kerberos.
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ji7ij3w5vhf7m0fmby6.png)
 
 You can configure the Windows Firewall service to control connections to the server:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7p5ji0ylu6a7n1lnlbz.png)
 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/neo54ai3nmfg60t5ivbc.png)