Teaching Research and Publishings Speaking Engagements Professional Development About Me

Notice: Undefined variable: connect in /var/www/codeadam.ca/includes/header.php on line 20

Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /var/www/codeadam.ca/includes/header.php on line 20

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /var/www/codeadam.ca/includes/header.php on line 22

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in /var/www/codeadam.ca/includes/header.php on line 24

Server Setup Documents

Setting up Codeanywhere

Update Your System

Before we start setting up everything today let's make sure everything is up to date. Open the Google Cloud SSH tool and run an update command:

sudo apt-get update


Codeanywhere is a fast and light cloud code editor engineered for the developer on the go. Register for a Codeanywhere account.

Note: I recommend that everyone use Codeanywhere but you are free to use your own program if so desired. You will need to figure out how to connect using SSH keys and an FTP connection.

Once you have registered for Codeanywhere follow these steps to allow Codeanywhere access to your Google Cloud:

  1. Obtain your public SSH key by clicking the profile button (top right), then Account Dashboard and then SSH Keys.

  2. Copy your SSH Public Key.

  3. Go back to your Google Cloud console and click Compute Engine, then MetaData and then SSH Keys.

  4. Click Edit, Add Item, paste the public key into the textarea and click Save.

  5. Next we need to set up the connection in Codeanywhere with these details.

Note: Use your domain, hostname and your initial dir.

Folder Permissions

At this point Codeanywhere will be able to connect, but will not be able to make any changes to files. We need to give the Codeanywhere user access to the web folders. Open up the SSH and follow these steps:

  1. Locate the /var/www folder:

    cd /
    cd var
    ls -la

    You will notice that the /var/www folder exists but belongs to the root user.

  2. Change the folder permissionss

    sudo chmod -R 776 /var/www
  3. Change the owners of these files to the www-data user:

    sudo chown -R www-data:www-data /var/www
  4. Lastly, we will add the Codeanywhere and our Google user to the www-data group:

    sudo usermod -a -G www-data codeanywhere-ssh-key
    sudo usermod -a -G www-data googleuser

    Note: Your Google use is the portion of your email address before the @.

    Note: If you still can't make changes try refreshing Codeanywhere or rebooting yourserver:

    sudo reboot