Skip to content
Wilbur Longwisch edited this page May 31, 2023 · 11 revisions

RHEL 9 Installation Instructions

Install all the components that are necessary

yum install mod_ssl httpd php mariadb-server php-pdo php-mysqlnd php-mbstring php-snmp php-xml php-snmp php-gd php-ldap php-intl graphviz graphviz-gd wget vim

Enable mariadb and apache to start at boot

systemctl enable httpd.service --now
systemctl enable mariadb.service --now

Configure mariadb

mysql_secure_installation

Switch to unix_socket authentication [Y/n] n
Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Remove anonymous users? [Y/n]
 ... Success!
Disallow root login remotely? [Y/n]
 ... Success!
Remove test database and access to it? [Y/n]
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
Reload privilege tables now? [Y/n]
 ... Success!

Create database

#  mysql -u root -p
MariaDB [(none)]> create database dcim;
MariaDB [(none)]> grant all privileges on dcim.* to 'dcim' identified by 'dcim';
MariaDB [(none)]> exit

Add a virtual host for opendcim

# vim /etc/httpd/conf.d/opendcim.conf
 <VirtualHost *:443>
     ServerAdmin [email protected]
     DocumentRoot /opt/openDCIM/opendcim
     ServerName opendcim.example.net
     SSLCertificateKeyFile "/etc/pki/tls/private/localhost.key"
     SSLCertificateFile "/etc/pki/tls/certs/localhost.crt"
     SSLCACertificateFile "/etc/pki/tls/certs/ca-bundle.crt"
     AllowEncodedSlashes On
     <Directory /opt/openDCIM/opendcim>
         AllowOverride All
         AuthType Basic
         AuthName "openDCIM"   
         AuthUserFile /opt/openDCIM/.htpasswd
         Require valid-user
     </Directory>
 </VirtualHost>

Create opendcim directories and get application from github

mkdir -p /opt/openDCIM/
cd /opt/openDCIM/
wget https://github.com/opendcim/openDCIM/archive/refs/tags/23.01.tar.gz
tar -zxpf 23.01.tar.gz
ln -s openDCIM-23.01 opendcim
mkdir -p assets/{pictures,drawings}
chown apache:apache assets/*
ln -s /opt/openDCIM/assets/ /opt/openDCIM/opendcim/
cp opendcim/db.inc.php-dist opendcim/db.inc.php

Either disable selinux or plan to deal with it.

semanage fcontext -a -t httpd_sys_rw_content_t "/opt/openDCIM/assets(/.*)?"
restorecon -R -v /opt/openDCIM/assets

Add user to htpasswd for apache authentication

htpasswd -c /opt/openDCIM/.htpasswd dcim

Open the default firewall rules to allow connection to apache

firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --reload

Reload apache config after adding virtualhost

systemctl reload httpd

Log in as user dcim and whatever password you set and finish the install

https://<server ip goes here>
Clone this wiki locally