Skip to content

Instantly share code, notes, and snippets.

@chaitanyabd
Forked from thursby/c9-cent7.md
Created March 23, 2020 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chaitanyabd/92f1c0e18dafd39a7c495e31f34228eb to your computer and use it in GitHub Desktop.
Save chaitanyabd/92f1c0e18dafd39a7c495e31f34228eb to your computer and use it in GitHub Desktop.
Install Cloud9 IDE under CentOS 7 with Let's Encrypt SSL

First, get a working CentOS 7 server with your preferred stack. Next, install requirements:

yum groupinstall -y development
yum install -y git glibc-static epel-release nodejs npm

Now clone the git repo and Install the Cloud9 SDK:

git clone https://github.com/c9/core.git c9sdk
cd c9sdk/
scripts/install-sdk.sh

Get DNS set up to point to the box, then use Certbot to get a Let's Encrypt cert:

sudo yum install certbot
certbot certonly --webroot -w /var/www/html/ -d $hostname

The output from this command shows you where the cert is saved.

Combine the cert and private key, and put the result somewhere c9 can see it.

cd /etc/letsencrypt/live/$hostname/
openssl rsa -in privkey.pem -out privkey_rsa.pem
touch combined_key.pem | cat privkey_rsa.pem fullchain.pem >> combined_key.pem
mv combined_key.pem /home/$user/c9sdk
chown $user:$user /home/$user/c9sdk/combined_key.pem

To keep it running, use Forever:

sudo npm install forever -g
cd c9sdk
forever start server.js -p 8080 -w ~/workspace/ -l 0.0.0.0 --auth developer:cleverpassword --secure combined_key.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment