Skip to content

Instantly share code, notes, and snippets.

@ArturDorochowicz
Last active March 31, 2020 19:32
Show Gist options
  • Save ArturDorochowicz/9791982 to your computer and use it in GitHub Desktop.
Save ArturDorochowicz/9791982 to your computer and use it in GitHub Desktop.
Installing Pivotal Project Monitor on Bitnami Ruby Stack VM in Azure.

Pivotal Project Monitor on Bitnami Ruby Stack

https://github.com/pivotal/projectmonitor

Project Monitor
https://github.com/pivotal/projectmonitor/tree/59314de57d614c8c0e8e75f53969afa7498a0ff6
Requires Ruby 2.0.0

Bitnami Ruby Stack image on Azure
Ruby Stack 2.0.0-23 (Ubuntu 14.04)
https://vmdepot.msopentech.com/Vhd/Show?vhdId=50007&version=51125

sudo /opt/bitnami/rubyconsole

git clone

cd /opt/bitnami/apps
git clone https://github.com/pivotal/projectmonitor.git
cd projectmonitor

Set write permissions for Apache

chown daemon tmp
chown daemon log

Install dependencies

apt-get install libxml2-dev
apt-get install zlib1g-dev
bundle install --without development test

Configure database

rake setup

Default PostgreSQL user/password:
postgres / bitnami

Edit config/database.yml

development: &development
  adapter: postgresql
  database: projectmonitor_development
  host: localhost

test:
  <<: *development
  database: projectmonitor_test
  
production:
  <<: *development
  database: projectmonitor_production
  user: postgres
  password: bitnami

Create database

RAILS_ENV=production rake db:create
RAILS_ENV=production rake db:migrate

Create user

rails c production
User.create!(login: 'pm-admin', name: 'pm-admin', email: 'pm-admin@example.com', password: 'password', password_confirmation: 'password')

Configure Apache

Edit /opt/bitnami/apache2/conf/bitnami/bitnami.conf

Move existing HTTPS host to a different port.

Listen 44300

...

<VirtualHost _default_:44300> 

Edit /opt/bitnami/apache2/conf/bitnami/bitnami-apps-vhosts.conf

Server key file must not have a password.

# Bitnami applications installed in a Virtual Host

Listen 443

<VirtualHost _default_:443>
  ServerName domain-matching-ssl-cert.com

  DocumentRoot "/opt/bitnami/apps/projectmonitor/public"
  SSLEngine on
  SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
  SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"

  PassengerEnabled on
  PassengerBaseURI /
  PassengerAppRoot "/opt/bitnami/apps/projectmonitor"

  <Directory "/opt/bitnami/apps/projectmonitor/public">
    Require all granted
    Options -MultiViews
  </Directory>

</VirtualHost>

Restart Apache

/opt/bitnami/stack/ctlscript.sh restart apache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment