Skip to content

OpenSUSE

Wilbur Longwisch edited this page Oct 15, 2023 · 5 revisions

OpenSUSE 15 Installation Instructions

Install all the components that are necessary

zypper install -yl apache2 php8 apache2-mod_php8 php8-cli php8-dba php8-exif php8-fileinfo php8-gd php8-gettext php8-intl php8-ldap php8-mbstring php8-mysql php8-pdo php8-posix php8-snmp php8-zip graphviz gd mariadb

Enable mariadb and apache to start at boot

systemctl enable apache2.service --now
systemctl enable mariadb.service --now

Configure mariadb

mysql_secure_installation

Switch to unix_socket authentication [Y/n] n
 ... skipping.
Change the root password? [Y/n]
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

Create SSL certificate

openssl req -x509 -newkey rsa:4096 -keyout /etc/apache2/ssl.key/localhost.key -out /etc/apache2/ssl.crt/localhost.crt -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=$(hostname)"

Add a virtual host for opendcim

# vim /etc/apache2/conf.d/opendcim.conf
 <VirtualHost *:443>
     ServerAdmin [email protected]
     DocumentRoot /opt/openDCIM/opendcim
     ServerName opendcim.example.net
     SSLEngine on
     SSLCertificateKeyFile "/etc/apache2/ssl.key/localhost.key"
     SSLCertificateFile "/etc/apache2/ssl.crt/localhost.crt"
     AllowEncodedSlashes On
     <Directory "/opt/openDCIM">
         AllowOverride None
         Options FollowSymLinks
         # Allow open access:
         Require all granted
     </Directory>
     <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.04.tar.gz
tar -zxpf 23.04.tar.gz
ln -s openDCIM-23.04 opendcim
mkdir -p assets/{pictures,drawings}
chown wwwrun:wwwrun assets/*
ln -s /opt/openDCIM/assets/ /opt/openDCIM/opendcim/
cp opendcim/db.inc.php-dist opendcim/db.inc.php

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

Enable SSL usage in apache

[[ ! $(grep ^APACHE_SERVER_FLAGS= /etc/sysconfig/apache2 | grep SSL) ]] && sed -i.bak 's/APACHE_SERVER_FLAGS="[^"]*/& SSL/' /etc/sysconfig/apache2

Restart apache after adding virtualhost

systemctl restart httpd

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

https://<server ip goes here>