Automatically setting up a server and deploying web applications.
-
Create a private key "$ openssl genpkey -algorithm RSA - out *secret_key.*pem -pkeyopt rsa_keygen_bits:2048"
-
Crete Public Key "$ openssl rsa -pubout -in secret_key.pem -out public_key.pem"
-
Download terraform to your machine
-
Move the terraform executable to either your usr/local/bin or variable Paths
-
Navigate to access.tf and add your AWS access and secret key
-
Navigate to variables.tf and add your public key and the names of any security group.
-
In the terminal, run Terraform Plan and check the output
-
In the terminal, run Terraform Apply
-
Check AWS console to see if the instance has started.
-
SSH into the instance using your private key
-
Setting up the server through SSH. echo 'http://the_new_ec2_instance.amazon.com proxy / localhost:3000{ websocket transparent }' >/var/snap/rocketchat-server/current/Caddyfile
-
sudo systemctl restart snap.rocketchat-server.rocketchat-caddy
-
sudo systemctl status snap.rocketchat-server.rocketchat-caddy