From 93cff7d4fca4795b45471954206f998b374eeef8 Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 15 Jan 2024 00:10:37 +0100 Subject: [PATCH] Complete file 'README.install-with-rbenv'. --- README.install-with-rbenv | 101 +++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/README.install-with-rbenv b/README.install-with-rbenv index 1ef1149..c5f490e 100644 --- a/README.install-with-rbenv +++ b/README.install-with-rbenv @@ -74,7 +74,12 @@ apt install yarn # 3. Install ruby using rbenv (Ruby version mmanager) # --- +USER=webadmin + +su - ${USER} + RUBY_VERSION=3.2.2 +SHELL="/bin/bash" # Next we're going to install Ruby using a Ruby version mmanager called rbenv. # It is the easiest and simplest option, plus it comes with some handy plugins @@ -90,9 +95,12 @@ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc git clone https://github.com/rbenv/rbenv-vars.git ~/.rbenv/plugins/rbenv-vars -#exec $SHELL +exec $SHELL rbenv install ${RUBY_VERSION} + +# Activate this Ruby version as the new default: +# rbenv global ${RUBY_VERSION} # Test ruby version @@ -117,7 +125,98 @@ ruby -v gem install bundler +?? bundler install ?? + + # Test version of bundler # bundle -v +# exit user $USER +# +exit + + +# --- +# 5. Install NGINX +# --- + +# Note! +# use install script +# +# /usr/local/src/nginx/install_nginx.sh +# +# from nginx git repository at https://git.oopen.de +# +cd /usr/local/src/ +if [[ ! -d "/usr/local/src/nginx" ]] ; then + git clone https://git.oopen.de/install/nginx +fi + +# Install nginx +# +/usr/local/src/nginx/install_nginx.sh + +# Install dehydrated (Let's encrypt certification tool) +# +cd /usr/local/src/ +if [[ ! -d "/usr/local/src/dehydrated-cron" ]] ; then + git clone https://git.oopen.de/certificates/dehydrated-cron +fi + +# Install dehydrated.. +# +/usr/local/src/dehydrated-cron/install_dehydrated.sh + + + +# --- +# 6. Install Passenger packages +# --- + +# see also: +# https://www.phusionpassenger.com/docs/advanced_guides/install_and_upgrade/nginx/install/oss/bookworm.html +# https://www.phusionpassenger.com/docs/advanced_guides/install_and_upgrade/nginx/install/#select_os + +# install pre-requisites +# +apt-get install -y dirmngr gnupg \ + apt-transport-https \ + ca-certificates curl + + +# Install PGP key for phusionpassenger.com's repository +# and add HTTPS support for APT +# +curl https://oss-binaries.phusionpassenger.com/auto-software-signing-gpg-key.txt \ + | gpg --dearmor \ + | sudo tee /etc/apt/trusted.gpg.d/phusion.gpg >/dev/null + +echo "deb https://oss-binaries.phusionpassenger.com/apt/passenger bookworm main" > /etc/apt/sources.list.d/passenger.list +apt update + + +# Install Passenger + Nginx module +# +apt-get install -y libnginx-mod-http-passenger + +# Load passenger module +# +if [ ! -f /etc/nginx/modules-enabled/50-mod-http-passenger.conf ]; then + ln -s /usr/share/nginx/modules-available/mod-http-passenger.load /etc/nginx/modules-enabled/50-mod-http-passenger.conf +fi + +# Adjust passenger configuration +# +# Change the passenger_ruby line to match the following: +# +# passenger_ruby /var/www/.rbenv/shims/ruby; +# +perl -i -n -p -e "s/^((\s*passenger_ruby\s+).*)/#\1\n\2/var/www/.rbenv/shims/ruby;/" \ + /etc/nginx/conf.d/mod-http-passenger.conf +vim /etc/nginx/conf.d/mod-http-passenger.conf + + +# Restart NGINX webservice +# +systemctl restart nginx