Skip to content

Instantly share code, notes, and snippets.

@natanaelfneto
Last active October 5, 2021 08:09
Show Gist options
  • Save natanaelfneto/35fbee4ee839fa1386ee88509fa238ea to your computer and use it in GitHub Desktop.
Save natanaelfneto/35fbee4ee839fa1386ee88509fa238ea to your computer and use it in GitHub Desktop.
How to run DCM4CHEE on CentOS machine without JBOSS server

DCM4CHEE on CentOS machine

This Gist shows how to set up a CentOS machine to run a functional DCM4CHEE instance.

Getting CentOS 7 x86_64

Native

  1. download the desire iso at CentOS.org
  2. create a boot drive
  3. install it

Vagrant

  1. Download centos7 x86_64 Box
  2. Download Vagrant a. to download Vagrant for Debian, Windows, CentOS and MacOSX go to Vagrant.com b. to install vagrant via command line:
  • Debian: apt install vagrant -y
  • Windows: choco install vagrant
  • CentOs: yum install vagrant -y
  • MacOSX: Download, verify, and install VirtualBox and its extension pack:
brew install Caskroom/cask/virtualbox && brew install Caskroom/cask/virtualbox-extension-pack

Download, verify, and install Vagrant and Vagrant-Manager:

brew install Caskroom/cask/vagrant && brew install Caskroom/cask/vagrant-manager

if yout dont have the respective package manager for your system:

  • Windows OS: Chocolatey package manager. To install Chocolatey on Windows use the following code on your terminal, it can be on cmd:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

or with powershell:

Set-ExecutionPolicy AllSigned; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  • Mac OSX: Homebrew package manager. To install Homebrew on Mac use the following code on your terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. Create a folder to install the CentOS 7 machine:
  • bash: mkdir ~/vagrant/centos7
  • powershell: mkdir $env:userprofile/vagrant/centos7
  • cmd: mkdir "%userprofile%"/vagrant/centos7
  1. Move the downloaded box into new folder and openit:
  • bash:
mv centos-7.0-x86_64.box ~/vagrant/centos7/entos-7.0-x86_64.box && cd ~/vagrant/centos7
  • powershell:
(move-item "$env:userprofile/Downloads/centos-7.0-x86_64.box" "$env:userprofile/vagrant/centos7/centos-7.0-x86_64.box") and (cd $env:userprofile/vagrant/centos7/)
  • cdm:
move-item "$env:userprofile/Downloads/centos-7.0-x86_64.box" "$env:userprofile/vagrant/centos7/centos-7.0-x86_64.box" && cd $env:userprofile/vagrant/centos7/
  1. Add the centos7 box with vagrant:
  • bash/powershell/cdm:vagrant box add centos-7.0-x86_64.box --name centos7
  1. Start the Vagrantfile:
  • bash/powerhsell/cdm: vagrant init
  1. Edit Vagrantfile with any text editor:
  • bash:
nano ~/vagrant/centos7/Vagrantfile
  • powershell:
Get-Content "$env:userprofile"/vagrant/centos7/Vagrantfile
  • cmd:
more "%userprofile%"/vagrant/centos7/Vagrantfile

at file, replace: config.vm.box = "base" with: config.vm.box = "centos7"

also, uncomment: config.vm.network = "forwarded_port", guest: 80, host: 8080

add the line: config.vm.network = "forwarded_port", guest: 8000, host: 8000

and save it.

  1. Start virtual machine: vagrant up
  2. login with ssh command: vagrant ssh
  3. update and upgrade machine: sudo yum update -y && sudo yum upgrade -y

PostgreSQL

  1. Install the postgresql-server package and the "contrib" package:
sudo yum install postgresql-server postgresql-contrib -y
  1. Initialize your Postgres database and start PostgreSQL:
sudo postgresql-setup initdb
  1. Log as postgres user:
su - postgres
  1. Open the HBA configuration and edit host from:
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            ident
#host    replication     postgres        ::1/128                 ident

to:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            trust
#host    replication     postgres        ::1/128                 trust
  1. Start and enable PostgreSQL:
sudo systemctl start postgresql && sudo systemctl enable postgresql
  1. Configure PostgreSQL to start on boot:
sudo systemctl enable postgresql
  1. Change the postgres user’s Linux password:
sudo passwd postgres
  1. Set a password for the postgres database user:
psql -d template1 -c "ALTER USER postgres WITH PASSWORD 'newpassword';"

DCM4CHEE

Java

  1. Install Java SE 8: sudo yum install java-1.8.0-openjdk -y
  2. Install Java Development Package: sudo yum install java-1.8.0-openjdk-devel -y

DCM4CHEE Binaries

  1. Create a folder to alocate files:
mkdir ~/dcm4chee && cd ~/dcm4chee
  1. Download binaries for dcm4chee
  • 2.18:
wget https://ufpr.dl.sourceforge.net/project/dcm4che/dcm4chee/2.18.3/dcm4chee-2.18.3-psql.zip
  • 5.11:
wget https://ufpr.dl.sourceforge.net/project/dcm4che/dcm4chee-arc-light5/5.11.0/dcm4chee-arc-5.11.0-psql.zip
  1. Unzip files
  • 2.18:
unzip dcm4che-2.18.3-psql.zip
  • 5.11:
unzip dcm4chee-arc-5.11.0-psql.zip
  1. Create a DC4CHEE database on PostgreSQL:
createdb -h localhost -U postgres dcm4chee
  1. Setup $DCM4CHEE_ARC variable
  • 2.18:
export DCM4CHEE_ARC = ~/dcm4chee/dcm4che-2.18.3-psql
  • 5.11:
export DCM4CHEE_ARC = ~/dcm4chee/dcm4chee-arc-5.11.0-psql
  1. Create tables and indexes for DCM$CHEE datatable on PostgreSQL
  • 2.18:
psql -h localhost dcm4chee postgres < $DCM4CHEE_ARC/sql/create-psql.sql
  • 5.11:
psql -h localhost dcm4chee postgres < $DCM4CHEE_ARC/sql/create-psql.sql
psql -h localhost dcm4chee postgres < $DCM4CHEE_ARC/sql/create-fk-index.sql

DICOM Toolkit & Library

  1. Download and unzip binaries
  • 2.0.29:
cd ~/dcm4chee
wget https://ufpr.dl.sourceforge.net/project/dcm4che/dcm4che2/2.0.29/dcm4che-2.0.29-bin.zip
unzip dcm4che-2.0.29-bin.zip
  • 5.11:
cd ~/dcm4chee
wget https://ufpr.dl.sourceforge.net/project/dcm4che/dcm4che3/5.11.0/dcm4che-5.11.0-bin.zip
unzip dcm4che-5.11.0-bin.zip

@rafacs83
Copy link

I am having problems with the command, export DCM4CHEE_ARC = ~ / dcm4chee / dcm4che-2.18.3-psql

the message that appears: bash: export: `/root/dcm4chee/dcm4chee-2.18.3-psql ': is not a valid identifier, what can it be?

@jangtrung
Copy link

I am having problems with the command, export DCM4CHEE_ARC = ~ / dcm4chee / dcm4che-2.18.3-psql

the message that appears: bash: export: `/root/dcm4chee/dcm4chee-2.18.3-psql ': is not a valid identifier, what can it be?

It's should be export DCM4CHEE_ARC=~ / dcm4chee / dcm4che-2.18.3-psql

@Emrullah-ACAR
Copy link

Do you have a video about installation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment