Use this to talk to the Rstudio Connect server, and troubleshoot issues you encounter with it.
Helpful Info
Server OS: Ubuntu 20.04 LTSB
Server hosting provider: AWS
Hostname: rstudioconnect.knight.domains (done through knight.domains Zone Editor)
Connecting to Server
RSA Key: Key file (click link to download file)
- Place the key file somewhere you won't delete it, like ~/.ssh
- Change its permissions
chmod 600 ~/.ssh/rstudio.cer
Modify your .zshrc or .bashrc to have an alias of this command:
alias rstudio-connect="ssh -i "~/.ssh/rstudio.cer" ubuntu@rstudioconnect.knight.domains"
Run rstudio-connect in terminal to connect to the server.
Note: You will have to say Yes when it asks if you'd like to connect to the server, for the first time.
Secondary Note: If terminal comes back and says "command not found", you may need to quit/restart Terminal, or you can run 'zsh' or 'bash' (depending what you default shell is) to restart zsh or bash with your alias. Rerun rstudio-connect again
Important files
Maintenance Scripts
Script directory:
/usr/local/snc
./apache_checker.sh
- Found that certbot really wants/needs apache2 to run. So I check on the minute to see if apache2 is running. If it is, this script kills the service running apache2
./renew_cert.sh
- certbot's great, so we use it in this script to renew the ssl cert on the server. Without this, we'd have to manually issue a cert every three months, and that wouldn't be fun.
- Script also stops rstudioconnect service, and starts apache2 so certbot can run properly.
- At the end, the script stops apache and restarts rstudioconnect services.
- Puts server into a type of maintenance mode, so that apache_checker.sh quits if a tmp directory is found. tmp directory is created in the first line of this script, then hacked away at the end, so script can run again.
/var/log/snc/conflict.log
- check this log to see the last time apache_checker had to stop apache
RstudioConnect Files
All of this is factory default. All locations and attributes should be Google-able
If you'll have to modify anything, this is the file.
/etc/rstudio-connect/rstudio-connect.gcfg