Complete file 'README.install-with-rbenv'.
This commit is contained in:
parent
efb96986b8
commit
93cff7d4fc
@ -74,7 +74,12 @@ apt install yarn
|
|||||||
# 3. Install ruby using rbenv (Ruby version mmanager)
|
# 3. Install ruby using rbenv (Ruby version mmanager)
|
||||||
# ---
|
# ---
|
||||||
|
|
||||||
|
USER=webadmin
|
||||||
|
|
||||||
|
su - ${USER}
|
||||||
|
|
||||||
RUBY_VERSION=3.2.2
|
RUBY_VERSION=3.2.2
|
||||||
|
SHELL="/bin/bash"
|
||||||
|
|
||||||
# Next we're going to install Ruby using a Ruby version mmanager called rbenv.
|
# 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
|
# 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
|
git clone https://github.com/rbenv/rbenv-vars.git ~/.rbenv/plugins/rbenv-vars
|
||||||
|
|
||||||
#exec $SHELL
|
exec $SHELL
|
||||||
|
|
||||||
rbenv install ${RUBY_VERSION}
|
rbenv install ${RUBY_VERSION}
|
||||||
|
|
||||||
|
# Activate this Ruby version as the new default:
|
||||||
|
#
|
||||||
rbenv global ${RUBY_VERSION}
|
rbenv global ${RUBY_VERSION}
|
||||||
|
|
||||||
# Test ruby version
|
# Test ruby version
|
||||||
@ -117,7 +125,98 @@ ruby -v
|
|||||||
gem install bundler
|
gem install bundler
|
||||||
|
|
||||||
|
|
||||||
|
?? bundler install ??
|
||||||
|
|
||||||
|
|
||||||
# Test version of bundler
|
# Test version of bundler
|
||||||
#
|
#
|
||||||
bundle -v
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user