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:
Obtain your public SSH key by clicking the profile button (top right), then Account Dashboard and then SSH Keys.
Copy your SSH Public Key.
Go back to your Google Cloud console and click Compute Engine, then MetaData and then SSH Keys.
Click Edit, Add Item, paste the public key into the textarea and click Save.
Next we need to set up the connection in Codeanywhere with these details.
Note: Use your domain, hostname and your initial dir.
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:
You will notice that the
/var/wwwfolder exists but belongs to the root user.
Change the folder permissionss
sudo chmod -R 776 /var/www
Change the owners of these files to the
sudo chown -R www-data:www-data /var/www
Lastly, we will add the Codeanywhere and our Google user to the
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: