How to have SSL secured connection without buying a domain name?

in #utopian-io6 years ago (edited)

Purpose of this post


This is a post for all those web developers who want a free domain name just to run some simple app or scripts without the intention to even build a website. If you're building a website it's better to buy a domain name for as cheap as 12$ per year. (from google domain) So this post is targeted for cheapskate developer :D

What is SSL?


SSL stands for Secured Sockets Layer and it is the standard encrypted protocol between a web server and a client(in this case your browser like Firefox or Internet Explorer). In a more familiar manner, do you notice the green lock sign everytime you browse steemit? Another telltale would be http:// become https://. So what really happens? Yeap it's all SSL.
SSL.jpg

Great, why do I need SSL for?


SImple. To prevent hackers from "sniffing" sensitive information out of your transaction. For example, your credit card info, your identification number and etc. You can even hide your age too, if you don't want the other person to know that you're too old to get married. A joke of course. Yes SSL is important, how do I set it up?

Set up procedure


The first law to install a SSL is you need a domain name. But as a cheapskate dev, we don't want to buy a domain name. Let's use DDNS instead. Dynamic DNS is a service that keeps track of the IP address of your web server and it's for free! Great! The only downside is that you have less preference on which domain to choose from. As we're just running scripts from server. IT shouldn't be a concern.

1) Register your ip address with dynu.com

Register a new account, pick a domain name and input your IP address and you're done with first step!

dynu.jpg

2) You need to install an IP update client from your Linux webserver

If you're using Linux :
URL='https://www.dynu.com/support/downloadfile/31'; FILE=`mktemp`; wget "$URL" -qO $FILE && sudo dpkg -i $FILE; rm $FILE

then you need to modify the config file to configure the IP update client :
sudo vi /etc/dynuiuc/dynuiuc.conf

You should edit the config file according to this :

password YOURPASSWORD  # Your account password or IP update password. 
location LOCATIONNAME  # Can be left empty. Location name can be assigned to hostnames in the control panel.
ipv4 true              # Can be true or false.
ipv6 false             # Can be true or false.
pollinterval 300       # IP update interval in seconds. Minimum is 120.
debug false            # Can be true or false.
quiet true             # Can be true or false.



After that reload the IP update client service with this command :
systemctl restart dynuiuc.service

3) Make your webserver to acknowledge such domain name

If you haven't installed nginx on your web server, please type the following :
sudo apt-get update
sudo apt-get install nginx

After that you need to reconfigure the nginx server by modifying this file :
sudo vi /etc/nginx/sites-available/default

You should have something like this :

    listen 80;

    server_name your_domain.com;

    location / {
        proxy_pass http://private_ip_address:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
     }
}



Now fill in according to the text

After that you need to reload the nginx service :
$ sudo /etc/init.d/nginx reload

4) Use certbox to install SSL certificate to DDNS

First as usual, you need to install certbot :
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
$ sudo apt-get install python-certbot-nginx 



Then you need to assign the SSL certificate to your new DDNS from dynu.com
$ sudo certbot --nginx

And congrates you installed SSL certificate to your web server!
certbot2.jpg

5) Now run your domain name on browser, there should be a green key sign! And youre done!

You just run a SSL encrypted web server without buying a rather costy domain name!
Hope you enjoyed my tutorial! Stay tune for next :)

steembannerforme.jpg



















Sort:  

@tngflx, Contribution to open source project, I like you and upvote.

You can earn a flag if you keep spamming.

um... please don't mind me, I am just testing this out. I am not spamming, really. I'll be on my way now. oh yes... I just upvoted you by the way. Stephard Tester, superoo7/superoo7-dev

Thanks man

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by Felix at(tngflx) from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 64344.02
ETH 3142.36
USDT 1.00
SBD 4.01