All pages
Powered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

Connecting via WinSCP

Connecting to your server with WinSCP or VSCode

This page will walk you through connecting to your new server using the popular free software program WinSCP. I have a script for you to download on step 11 "Managing your web site" page.

WinSCP let's get going

  • Run WinSCP

  • In the Login dialog, click on the “New Session” button

  • Then click the "Advanced..." button

  • From this dialog select the SSH Authentication browse button to the right of the input box.

  • You will be given a file explorer box. Then select your pem file that you downloaded when you created your ec2. The prompt with look like this click ok.

  • Click the ok button

  • You have connected

Connect via WinSCP
SSU Authentication
Convert PEM file to a PPK file
Final Connection Step

Connecting via VSCode

VSCode is one of the hottest new editors on the market. We will show you how to connect via VSCode using the VSCode Remote Development Extension.

You can install the VSCode Remote Development Extension by visiting the URL or opening VSCode and clicking the extension load button in the IDE and searching for "Remote Development."

Remote Development Extension

Steps to connect to ec2.

  • Click in the green box in the bottom left corner of VSCode. This will open a select box already populated with different Remote Development choices. You want to select Remote-SSH: Open SSH Configuration File...

  • If you have not created a configuration file you will have this option. Remote-SSH: Add New SSH Host... Select that instead.

  • Your configuration file should look something like this after you fill it out.

  • Having done that it is time to connect to your ec2 instance. Let's click the green button in the lower left corner. The same one we used to open the configuration file. Let's select "Remote-SSH: Connect Current Window to Host..."

  • If all works you should have a VSCode screen that looks like the one below. If it does not work you can do what I did, that is to downgrade to VSCode 1.36.1. You can do that with Chocolatey.

How to customize sites

By default you are given 2 web sites. This page will show you how to display and edit those sites.

Default Sites

The sites you are given are http://website1.com and http://website2.com. You can display these in your Windows Host file at C:\Windows\System32\drivers\etc\hosts. To see the site you add the entries like this below.

3.229.122.138		website1.com
3.229.122.138		website2.com

Open a browser with those URLS and you will see your site with the default ColdBox frameworks. In order to set different site names you will want to edit website1.conf and website2.conf files open a shell and navigate to:

/etc/nginx/sites-enabled# ls
website1.conf  website2.conf
cat website2.conf
  • replace all website2.com entries except the directory.

  • Restart Nginx and restart the server. Open your new site.

###############################################################
# Example
###############################################################
server {
        ################### SERVER NAME AND PORT #####################
        listen 80;
    server_name website2.com;

        ################### LOGS #####################
        access_log /var/log/nginx/website2-access.log;
        error_log /var/log/nginx/website2-error.log warn;
        rewrite_log off;

        ################### LOCATION #####################
        root /var/www/website2;

        ################### CFML #####################
        # Mod_cfml (Lucee) specific: add a unique ID for this server block.
        # For more info, see http://www.modcfml.org/index.cfm/install/web-server-components/nginx-all-os/
        set $lucee_context "website2.com";

        set $application_port "8002";
        include lucee.conf;
}
Host ColdBoxDemo
    User ubuntu
    HostName 34.236.192.135
    IdentityFile ~/.ssh/my-pem-that-i-downloaded-when-creating-ec2.pem
Remote-SSH: Open SSH Configuration File...
Remote-SSH: Connect Current Window to Host...
Notice you are on the ec2 server. You can run CommandBox Commands from here.
choco install vscode --version=1.36.1 -y

Changelog

Version 1.0.0_5.3.7.47

  • Initial Release