hey, I am very new to Networking and cloud,
i was trying to host two servers in same droplet, i.e., nodejs and Angular , i have one sub domain eg: test.example.com, is it possible that i can host these two server under this same subdomain name.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello, @keerthidl

Speaking of DNS you can point a subdomain name to a single IP address (point the subdomain to the IP address of your droplet).

You can use multple subdomains (and host multiple websites as well) on a single droplet. You just need to configure the Virtual Hosts for the subdomains in the web server (Apache, Nginx) configuration files.

You can check out tutorial on how to set up a node.js application on Ubuntu 18.04

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-18-04

Prerequisites

This guide assumes that you have the following:

An Ubuntu 18.04 server setup, as described in the initial server setup guide for Ubuntu 18.04. You should have a non-root user with sudo privileges and an active firewall.

A domain name pointed at your server’s public IP. This tutorial will use the domain name example.com throughout.

Nginx installed, as covered in How To Install Nginx on Ubuntu 18.04.

Nginx configured with SSL using Let’s Encrypt certificates. How To Secure Nginx with Let’s Encrypt on Ubuntu 18.04 will walk you through the process.

Hope this helps!

Regards,
Alex

by Justin Ellingwood
by Kathleen Juell
Nginx is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet. It is more resource-friendly than Apache in most cases and can be used as a web server or reverse proxy. In this guide, we'll discuss how to get Nginx installed on your Ubuntu 18.04 server.
Submit an Answer