-
Notifications
You must be signed in to change notification settings - Fork 206
OpenSUSE
Wilbur Longwisch edited this page Oct 15, 2023
·
5 revisions
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
systemctl enable apache2.service --now
systemctl enable mariadb.service --now
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!
# mysql -u root -p
MariaDB [(none)]> create database dcim;
MariaDB [(none)]> grant all privileges on dcim.* to 'dcim' identified by 'dcim';
MariaDB [(none)]> exit
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)"
# 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>
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
htpasswd -c /opt/openDCIM/.htpasswd dcim
firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --reload
[[ ! $(grep ^APACHE_SERVER_FLAGS= /etc/sysconfig/apache2 | grep SSL) ]] && sed -i.bak 's/APACHE_SERVER_FLAGS="[^"]*/& SSL/' /etc/sysconfig/apache2
systemctl restart httpd
https://<server ip goes here>