Skip to main content

Using LetsEncrypt to install free SSL on AWS server ec2 machine( Meteor version 1.6)


Installation of meteor project on AWS could be a real headache if you are not familiar with AWS environment. But with the help of various blogs on Medium, you can Do the installation and your project would be live. But there is one more thing that usually causes severe pain for Developers. that is the installation of SSL certificate. 
Most of the content on the web is almost 2-3 years old. So many  things got changed since then. so we felt an utter need for a blog that could guide us through this process.
let's start.

1. Login with SSH command on your Ubuntu machine.

2. Go to your project directory by typing  
    cd  /var/www/html/
3. go inside your project and then in app-deploy folder. Now run 
    mup stop 
command to stop the current instance that is running on the server. Now go out with cd .. command to HTML folder(cd  /var/www/html/).

4. Now install LetsEncrypt on your virtual machine.
type this command 
    
    git clone https://github.com/letsencrypt/letsencrypt

5. Now go inside LetsEncrypt folder with 
    cd letsencrypt


6. Now we need to generate the required SSL certificate with the command 
    ./letsencrypt-auto certonly --standalone
6.  Once this command is executed, it will give you the path where your certificates were generated. So navigate to that folder with this command
     cd /etc/letsencrypt/live/YourSiteName.com
7.  Now we need to combine our certificate with our key (AWS private key) with these 2 commands
     touch ssl.pem         
     cat fullchain.pem privkey.

8. Go back to your project & then inside app deploy and  restart yur mup instance with command
     mup start
9. You machine would be back in the machine would be back in the game. Now if you want the user to always get redirected to 'https' even if he types 'http', we can do it with forcessl package with this command.

          meteor add force-ssl

10. now in your mup.js file add this 
      "ssl": {
              "pem": "ssl.pem"
             }
 and also change 
      http://yoursitename.com to https://yoursitename.com

Then save these changes.
 
11. Now setup mup and redeploy it with command
      mup setup && mup deploy


Once this is Complete SSL would be installed on our website and enjoy free SSL for next 3 months.

Comments

Post a Comment

Popular posts from this blog

Meteor JS REST API

WRITE A POST Shahid Shaikh FOLLOW Engineer, Blogger from Mumbai. RESTful CRUD Operations in Meteor.js Published Dec 31, 2015 Last updated Jan 19, 2017 Introduction Meteor is a popular framework for building real-time web applications. We have already covered a tutorial which explains  how to build chat system using Meteor.js . In this tutorial, we will learn how to develop a RESTful API using Meteor which perform CRUD operations. Creating new project Create a new meteor project using the following command: meteor create appName Choose an application name of your choice. Once Meteor is done creating the project, you will see the directories and files created by Meteor in the folder name. We will not need them as of now, so we will delete all of those files and create whatever we need in the coming section. Installing iron-router In order to perform routing in Meteor, we will use  this awesome...

Meteor Mongodb Mup Commands

docker exec -it mongodb mongo docker cp mongodb:dump/ce5-meteor . If deployed with mup, you are in luck. You can find the steps here:  https://github.com/xpressabhi/mup-data-backup Here are the steps again: MongoDB Data Backup deployed via mup These commands run well only if meteor deployed with mup tool. Mup creates docker for mongodb hence taking backup becomes easy with these commands. Backup Take backup of running app data from docker then copy to local folder out of docker. docker exec -it mongodb mongodump --archive= /root/m ongodump. gz --gzip docker cp mongodb : /root/m ongodump. gz mongodump_$ (date +%Y-%m-%d_%H-%M-%S). gz Copy backup to server Move data to another server/local machine or a backup location scp /path/to/dumpfile root@ serverip : /path/ to/backup Delete old data from meteor deployment Get into mongo console running in docker then drop current database before getting new data. docker exec -it mongodb mongo appName db. runCommand ( { dropDatabase : 1 } ) ...