Self Hosting
Creating DNS Records
purchased domain from Namecheap , and using Cloudfare as DNS server...need to add an A record in the DNS record management part in Cloudfare dashboard...
- use @ for root
- put the ip of your server in the IPv$ address section
- disable proxy status (we're setup in our server later)
- and set TTL (time to leave) as low as possible to avoid cache
- finally click save

Query DNS Records with Dig
from your linux system run
subdomain, CNAME, TEXT Records
doc link: https://wizardzines.com/zines/dns/ https://messwithdns.net/
SSH to your VPS with a domain name
lsof -i :80
This will show the process ID (PID) of the service using port 80.
nc -l 80
listen to requests coming to port 80
we can respond to the requests from netcat
Install Caddy web server (alternative of Nginx)
doc link: https://caddyserver.com/docs/install#debian-ubuntu-raspbian
check if caddy is running
add https
then replace :80 with domain name , say softpipertesting.xyz
restart the caddy service
redirect ip to the root domain
add this to the /etc/caddy/Caddyfile file.
Multiple Caddyfile Setup
navigate to /ctc/caddy
then
keep only , remove the rest
then
file name is changed to http-redirects
navigate back to /etc/caddy
modify the file to
create a symbolic link for http-redirects file from sites-available to sites-enabled
check if the link is created, from /etc/caddy/sites-enabled
it will show , http-redirects -> /etc/caddy/sites-available/http-redirects
restart the caddy service
redirect www subdomain to root domain
edit the http-redirects file in sites-available folder and add www.softpipertesting.xyz as space separated
setup /var/www folder
navigate to the var folder and
time 37 min , see to folder security
create an index file ,
navigate to the Caddy file in /etc/caddy and change the root
Transfer files to the server with scp
clone a git repository (public) to server
go to the directory and then clone the repository
Hide files from Caddy File server
anyone can access https://softpipertesting.xyz/.git/HEAD we need to hide it... go to the Caddyfile...modify it
handle errors in Caddyfile
Clone Private git repository with and SSH deploy key
generate and add ssh key to VPS
enter a unique filename like
adding ssh key to the ssh-agent
view the key
add the to the deploy key section in the github repository
install node js
Create a reverse proxy with caddy
edit the Caddyfile and add the line doc link: https://caddyserver.com/docs/caddyfile/directives/reverse_proxy
as our application is running on port 3000