Rstudio Server
Rstudio Server deployment
Install:
wget https://download2.rstudio.org/server/jammy/amd64/rstudio-server-2022.07.2-576-amd64.deb && \ sudo gdebi rstudio-server-2022.07.2-576-amd64.deb && \ rm rstudio-server-2022.07.2-576-amd64.deb && \ sudo adduser rstudio
Apache config
<VirtualHost *:80> <DNS ENTRY> ServerNameServerSignature Off /var/log/apache2/redirect.error.log ErrorLogLogLevel warn ProxyPreserveHost On "/" "http://localhost:8787/" ProxyPass "/" "http://localhost:8787/" ProxyPassReverse RewriteEngine on %{SERVER_NAME} =<DNS ENTRY> RewriteCond ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] RewriteRule</VirtualHost> <IfModule mod_ssl.c> <VirtualHost *:443> <DNS ENTRY> ServerNameServerSignature Off /var/log/apache2/redirect.error.log ErrorLogLogLevel warn ProxyPreserveHost On "/" "http://localhost:8787/" ProxyPass "/" "http://localhost:8787/" ProxyPassReverse /etc/letsencrypt/live/<DNS ENTRY>/fullchain.pem SSLCertificateFile /etc/letsencrypt/live/<DNS ENTRY>/privkey.pem SSLCertificateKeyFile /etc/letsencrypt/options-ssl-apache.conf Include</VirtualHost> </IfModule>
Generate SSL certs
sudo certbot --apache certonly
Enable the site
sudo a2ensite rstudio.conf && \ sudo systemctl reload apache2 && \ sudo systemctl status apache2