Build on Ubuntu - ovfc/losap GitHub Wiki

Install

The below direction allows for a test build on Ubuntu 18.04.5. This is not fully production-ready as it does not adjust passwords and settings like Sanjay's Direction. This process is still under development and might be adjusted to CentOS to improve similarity to the current build.

Initial build:

Install mysql 5.6.48

mkdir install_mysql
cd install_mysql
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-server_5.6.48-1debian9_amd64.deb-bundle.tar
tar xvf mysql-server_5.6.48-1debian9_amd64.deb-bundle.tar
sudo dpkg -i *.deb
sudo apt --fix-broken install

Direction found here

The install will ask you to create a root password. Once the install is complete start the server with sudo /etc/init.d/mysql start

Add the following to /etc/mysql/my.cnf

[mysqld]
datadir = /var/lib/mysql/
socket = /var/lib/mysql/mysql.sock

Connect into MySQL with mysql -h 127.0.0.1 -u root -p then run the following commands:

GRANT ALL PRIVILEGES ON * . * TO 'losap'@'localhost';
SET PASSWORD FOR  'losap'@'localhost' = PASSWORD('<password>');
CREATE DATABASE losap;

The password should match the config located losap/config/database.yml

Install RVM , Ruby 1.9.3, and Rails 3.2.13

The following might need to be done for this version of rails to work:

sudo nano /etc/apt/sources.list
add deb http://security.ubuntu.com/ubuntu bionic-security main
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
sudo apt update && apt-cache policy libssl1.0-dev
sudo apt-get install libssl1.0-dev

Then the following should work.

sudo apt install gnupg2
command curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
cd /tmp
curl -sSL https://get.rvm.io -o rvm.sh
cat /tmp/rvm.sh | bash -s stable --rails
source /home/<user>/.rvm/scripts/rvm

Clone the GitHub repo and move in to the folder for the next commands.

rvm install 1.9.3
rvm use 1.9.3
gem install bundler -v '~>1'

Direction found here

Prep for Production:

For this testing nginx and passenger were utilized. Again, to sync with the previous direction that needs to be adjusted.

Install passenger and nginx

gem install rack -v 1.6.0
gem install passenger -v -v 6.0.7
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libssl-dev
rvmsudo passenger-install-nginx-module

Once installed configure /opt/nginx/conf/nginx.conf:

Then just before the last } add:

server { 
listen 80; 
server_name <SERVER URL>; 
passenger_enabled on; 
root <PATH TO LOSAP DATA>/public; 
}

Run the following commands to get everything started:

bundle install
RAILS_ENV=production rake db:setup
RAILS_ENV=production rake assets:precompile
RAILS_ENV=production rake db:seed 
RAILS_ENV=production rake assets:precompile

Then run sudo /opt/nginx/sbin/nginx -t to test the configuration. If the configuration passes run sudo /opt/nginx/sbin/nginx -s reload.

⚠️ **GitHub.com Fallback** ⚠️