Redmine in Openshift

 In PaaS

redmine_logo_v1

What is OpenShift?

It is a cloud, it is from Red Hat. More precisely: A PaaS (Platform As A Service).

The following steps are needed: [Via GUI-Graphical User Interface]

  • Create an account in openshift
  • Installing the CLI and setting up environment
  • Create an application
  • Initialize a git repository

Create an account

Simply head to Openshift and fill in the form.

 

Setting up your environment

Access openshift account through CLI needs some basic authentication. To do that, install rhc in OS.Installation may differs from Operating System to Operatiing System.

Below link provides more details on this. https://developers.openshift.com/en/getting-started-client-tools.html

 

Create an application

Using Openshift GUI to create an application

Following steps will create Redmine for usage

1.Choose a type of application

choose_type_of_application

Enter redmine in search bar. click Redmine Package shown.

2.Configure the application

 

Give Public URL to access Redmine.Others like git repository, and corresponding Cartridges mysql,ruby are automatically selected by openshift itself.

choose_type_of_application1

Click create Application button to launch.

choose_type_of_application1-1

Mysql database will be created and credentials provide by openshift.

mysql_database1-2

Connect with Openshift and Openshift Application’s [via CLI]

Command Line Interface has multiple options to compare with Openshift GUI.If need to add or remove Cartridges from particular Application we can easily do it via CLI commands.

If openshift environment is already configured [if not please a have on https://developers.openshift.com/en/getting-started-client-tools.html follow below steps.

~$ > rhc setup

Enter user name and password of Openshift Account.

The wizard will ask token for communication.Generate a token now? (yes|no) type as yes

Generate a token now? (yes|no) yes

Token will be generated and kept in a separeate file inside .openshift folder in /home/your-admin-name/.openshift/express.conf

[Note : If we need to connect with another Openshift account delete the .openshift folder

~$ > rm -R /home/your-admin-name/.openshift

openshift

Your public SSH key must be uploaded to the OpenShift server to access code. Upload now? (yes|no) yes

it creates a default SSH file, followed by which it will ask for a separete key file.

Provide a name for this key: |your admin| ss

it automatically create a file and upload SSH file in openshift account.

ssh_file

Adding or Removing cartridges using rhc environment

Adding a phpmyadmin from redmine application

your-admin-name@administrator-desktop:~$ rhc cartridge add phpmyadmin -a redmine

Using phpmyadmin-4 (phpMyAdmin 4.0) for ‘phpmyadmin’ Adding phpmyadmin-4 to application ‘sdsd’ … done

phpmyadmin-4 (phpMyAdmin 4.0)


 

Gears:          Located with mysql-5.1, ruby-1.9
Connection URL: <your connection-name>

Please make note of these MySQL credentials again:

Root User: your username

Root Password: your password

URL: <your connection-name>

Removing a phpmyadmin from redmine application

your-admin-name@administrator-desktop:~$ rhc cartridge remove -a redmine -c phpMyAdmin

Once added everything get into openshift account via GUI and click Application name displays the list of cartridges installed and URL to access Redmine Application.

url_to_access_redmine_application.

If you have any available domain, it can be configured instead of the URL. For configuring those details click change option which is located near to URL.

redmine

Use admin as Username and Password to login.It is default once logged in we can change or modify the password.

login

Hands on Redmine Configuration.Now Redmine is ready to use but only thing is to configure email setup.

Once Logged in by using admin as username and password select Administration tab which is located at top left.

administration_tab

It gives number of services supported by redmine from that select settings.

settings

Select Email notificatios tab

email_notificatios_tab_

Initially configuration.yml has not been configured exactly with our requirement.so email configuration shows the below error

error

Use ssh to conncet Applicataion from CLI. To achive that, get into openshift account and select application. In Right corner ssh link will be given for that application.This ssh key will differ from application to application.

Use that key to connect with application.

connect_with_application

From CLI enter ssh key to connect particular application.

new-choose_type_of_application

\> ls [command will show the available folders and cartridges installed for that application]

app-deployments app-root git mysql ruby

Above folders app-deployments and app-root for deploying applications.Other folders git for git files, mysql for mysql configuration and data files,ruby for ruby configuration.

So we need configuration.yml to fix email notification error.

File is located at

/app-root/runtime/repo/config

change directory into

cd /app-root/runtime/repo/config

rename the configuration.yml.example into configuration.yml

[<your connection-name> config]\> mv configuration.yml.example configuration.yml

comment [ Use # – to comment ] :production and :development at bottom lines in configuration.yml

new-email_notificatios_tab_

After getting Email notification page without any issue.

Need to send a test mail to check whether email is configured properly.

click a Send a test email link to send a test mail.

send_a_test_mail

An error occurred while sending mail (getaddrinfo: Name or service not known)

getaddrinfo_name_or_service_not_known

Edit configuration.yml file

comment below lines and change delivery_method into sendmail in configuration.yml file

# default configuration options for all environments default:

# Outgoing emails configuration (see examples above)
email_delivery:
  delivery_method: :sendmail

# smtp_settings: # address: smtp.example.net # port: 25 # domain: example.net # authentication: :login # user_name:

“redmine@example.net” # password: “redmine”

save configuration.yml file

restart the application

[<your connection-name> config]\> ctl_all restart Restarting services Stopping MySQL 5.1 cartridge Starting MySQL 5.1 cartridge restarting Ruby cart

try to send test mail.

Some Other Issues:

 

An error occurred while sending mail (hostname does not match the server certificate)

hostname_does_not_match_the_server_certificate

Add below lines in environment.rb which is located in same config folder.

# Turn off auto TLS for e-mail ActionMailer::Base.smtp_settings[:openssl_verify_mode] = false ActionMailer::Base.smtp_settings[:enable_starttls_auto] = false

save environment.rb file

restart the application

[<your connection-name> config]\> ctl_all restart Restarting services Stopping MySQL 5.1 cartridge Starting MySQL 5.1 cartridge restarting Ruby cart

Now again try to send test mail.

send_mail_success

Refernce Sites:

http://www.redmine.org/projects/redmine/wiki/RedmineInstall

http://blog.tinle.org/?p=190

Recommended Posts
Comments
pingbacks / trackbacks

Leave a Comment

Start typing and press Enter to search