Install CaseLayer Billing with Cpanel

Install Dependencies

yum install -y git-core zlib zlib-devel gcc-c++ patch \
readline readline-devel libyaml-devel libffi-devel openssl-devel make \
bzip2 autoconf automake libtool bison curl sqlite-devel

Add to .bashrc

export PATH
export PATH="$HOME/.rbenv/bin:/home/username/.rbenv/bin:$PATH"

eval "$(rbenv init -)"

rbenv

~/.rbenv/bin/rbenv init

install ruby-bulid

cd
mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

Check install

curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
Checking for `rbenv' in PATH: /home/username/.rbenv/bin/rbenv
Checking for rbenv shims in PATH: OK
Checking `rbenv install' support: /home/username/.rbenv/plugins/ruby-build/bin/rbenv-install (ruby-build 20200819)
Counting installed Ruby versions: none
  There aren't any Ruby versions installed under `/home/username/.rbenv/versions'.
  You can install Ruby versions like so: rbenv install 2.2.4
Checking RubyGems settings: OK
Auditing installed plugins: OK

Install ruby

mkdir ~/tmp-ruby
export TMPDIR=/home/username/tmp-ruby
RUBY_CONFIGURE_OPTS=--disable-install-doc rbenv install 2.7.1

Installed ruby-2.7.1

Downloading ruby-2.7.1.tar.bz2...
                       -> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
                       Installing ruby-2.7.1...
                       Installed ruby-2.7.1 to /home/username.rbenv/versions/2.7.1

Install wkhtmltopdf wrapper script:

/usr/local/bin/wkhtmltopdf.sh xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf "$@"

Cpanel - Create Vhost ProxyPass

/etc/apache2/conf.d/userdata/ssl/2_4/caselayer/caselayer.com/proxy.conf ServerName domain.com UseCanonicalName On RequestHeader set X_FORWARDED_PROTO 'https' env=HTTPS ProxyPreserveHost On ProxyPass /a http://127.0.0.1:8001/a ProxyPassReverse /a http://127.0.0.1:8001/a <IfModule headers_module> RequestHeader set X_FORWARDED_PROTO 'https' env=HTTPS </IfModule>

Bundle Install

~/.rbenv/versions/2.7.1/bin/bundle install

Edit configuration file

install/main.yaml domain: domain.com wkhtmltopdf: '/usr/local/bin/wkhtmltopdf.sh' database_name: db_name database_username: db_user database_password: password database_host: localhost

Create .cl-path in home dir

~/.cl-path /home/username/caselayer_billing