How to configure Vepp on the Amazon EC2 Cloud
Let’s take a free virtual machine on Amazon EC2, configure it and connect it to Vepp. A harsh instruction for the dedicated.
What is Amazon EC2
Amazon EC2 is one of the AWS services, the biggest cloud platform in the whole world. AWS has 150 services for all kinds of areas: from machine learning to robotics. Amazon EC2 is used to create and launch virtual machines on a cloud. Such virtual machines are called instances.
You can launch any internet-project you want on instances. For instance, create websites.
You have to connect an instance to a control panel to be able to create a website on Amazon EC2. We’ll tell you about connecting to Vepp.
How to connect Vepp to an Amazon EC2 instance
A connection to EC2 requires 3 steps. 2 of those are on the side of AWS and only the last one is on the Vepp’s side. If you already have an instance, skip the first two steps and go straight into the third one. If not, start from the very beginning.
- Step 1. Launch an instance
- Step 2. Configure a connection to the instance
- Step 3. Connect the instance to Vepp
It won’t be easy. But if you follow our instructions and take it slow, it’ll be fine!
To begin with, sign up for AWS. Make sure to enter your actual email and credit card details (you will be charged 1$ for confirmation, don’t worry, you’ll get your money back as soon as possible).
AWS administration will check your account after registration, it usually takes no more than 24 hours. You will be informed about the activation in a letter. Once it comes, you’ll be able to create an instance.
Create an instance
This is how a ready instance in the AWS console looks
You’ll find instructions below but first, let’s clear things up: Vepp only works with servers on CentOS 7, so you need an instance with this particular OS.
Incstance’s technical characteristics depend solely on the project. If you just want to try EC2 out, choose a free instance t2.micro. It has 512 MB of RAM, that is not much but enough for the test.
To create an instance, follow this instruction:
- Sign in the AWS console and go to the section called Serviсеs — EC2. On a new page select Launch Instance.
- Then the image selection window will open. Click AWS Marketplace and search for CentOS. Choose the CentOS 7 image and click Select.
- Find a suitable instance and click Review and Launch.
- The access keys window will open. Select Create a new key pair. In the Key pair name field enter any name and click Download Key Pair.
- Download and save the keys in a safe place, you won’t be able to manage your instance without them. Then click Launch Instances.
To manage the newly created instance, you are going to need Putty. It’s free software that helps you work with a remote server through SSH.
Download Putty from the official website and install it on your desktop. You are gonna need an access key after installation. Putty doesn’t support the Amazon key format, that’s why you’re gonna have to convert your previously saved key.
Convert the access key
For the key conversion, you’ll need PuttyGen. This program has been installed along with Putty itself. Just find it in a list of installed programs.
- Open PuttyGen.
- Specify your connection type as RSA and hit the Load button. In a newly opened window choose the .Allfiles and select the previously save key.
- Click Save private key. The app will show you a warning, that your key is going to be saved without a code phrase. Click Yes.
- We’re all set! Now you have a key for Putty, it’s time to connect.
Connection to Putty
You’ll need a hostname like centos@publicDNS, to connect, where publicDNS is, of course, instance’s public DNS. Copy it in the Amazon EC2 console. Once your instance is ready, you’ll see the Running status and the public IP-address.
Hostname example: email@example.com
- Launch Putty.
- In Hostname field enter your login, the 22nd port, and the SSH connection type.
- Open the Connection — SSH — Auth tab and click Browse. Select your converted key file.
- Click Open. A new window will open. Send commands through this one.
Now you finally have an instance with a configured SSH-connection!
The hardest part is over, just a little bit more work. Now we’ll configure NAT for our instance and then add it in Vepp.
Configure NAT for the instance
You are going to have to open ports on your instance so that Vepp could work properly.
- Open the AWS console and go Serviсеs — EC2 section.
- The EC2 control panel will open. There you need to go to Network & Security → Security Groups and click Create Security Group to add a new rule table.
- On the Inbound tab add rules from the table and click Create.
- Go to Instances → Instances, click on the instance with RMB, and then select Actions → Networking → Change Security Groups.
- In a newly opened window find the created rule group, tick it and click Assign Security Groups.
Awesome! The network is configured, now you can connect your instance to Vepp.
Add the AWS instance to Vepp
At first, sign up for Vepp. When you confirm your email, the server connection window will open. Choose SSH-key and leave the tab open.
Add the key to Putty.
- Open Putty
- Run the mkdir -p ~/.ssh command.
- Run the echo <ssh-key>
>> ~/.ssh/authorized_keyscommand. Instead <ssh-key> of enter the key from Vepp.
- Run the chmod 400 ~/.ssh/authorized_keys command.
Add an instance to Vepp.
- Go back to the tab of server connection in Vepp.
- User is сentos. SSH-port is 22.
- Enter the server’s public IP-address. You can look it up in the EC2 console, on the Instances tab.
- Make sure all fields are filled and click Add. If everything is correct, the Vepp configuration will begin.
Phew, you did it! You created an instance and connected it to Vepp. The control panel will suggest configuring the work behind the NAT. Save your settings so that external addresses could be shown in the interface. Domains’ A records will also be automatically reconfigured for them.
Step 4. Start creating a website
You’re a hero! You’re done with the connection and you can create your own website. In comparison to previous steps, it’s very easy, and you’ll probably figure it out yourself. But here are some instructions for you just in case: