-
Notifications
You must be signed in to change notification settings - Fork 206
RHEL
Wilbur Longwisch edited this page Dec 5, 2023
·
11 revisions
yum -y module install php:8.0/common
yum -y install php php-gd php-intl php-ldap php-mysqlnd php-pdo php-snmp php-xml php-mbstring php-pecl-zip mod_ssl httpd mariadb-server gd graphviz wget vim tar
# optional for selinux management
yum -y install policycoreutils-python-utils
systemctl enable httpd.service --now
systemctl enable mariadb.service --now
mysql_secure_installation
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
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
# 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>
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 apache:apache assets/*
ln -s /opt/openDCIM/assets/ /opt/openDCIM/opendcim/
cp opendcim/db.inc.php-dist opendcim/db.inc.php
yum -y install $(for x in $(ls /opt/openDCIM/opendcim/locale/); do echo -n " glibc-langpack-${x%_*}"; done)
semanage fcontext -a -t httpd_sys_rw_content_t "/opt/openDCIM/assets(/.*)?"
restorecon -R -v /opt/openDCIM/assets
htpasswd -c /opt/openDCIM/.htpasswd dcim
firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --reload
systemctl reload httpd
https://<server ip goes here>
yum install mod_ssl httpd php mariadb-server php-pdo php-mysqlnd php-mbstring php-pecl-zip php-snmp php-xml php-snmp php-gd php-ldap php-intl graphviz graphviz-gd wget vim tar
systemctl enable httpd.service --now
systemctl enable mariadb.service --now
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!
# mysql -u root -p
MariaDB [(none)]> create database dcim;
MariaDB [(none)]> grant all privileges on dcim.* to 'dcim' identified by 'dcim';
MariaDB [(none)]> exit
# 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>
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 apache:apache assets/*
ln -s /opt/openDCIM/assets/ /opt/openDCIM/opendcim/
cp opendcim/db.inc.php-dist opendcim/db.inc.php
yum -y install $(for x in $(ls /opt/openDCIM/opendcim/locale/); do echo -n " glibc-langpack-${x%_*}"; done)
semanage fcontext -a -t httpd_sys_rw_content_t "/opt/openDCIM/assets(/.*)?"
restorecon -R -v /opt/openDCIM/assets
htpasswd -c /opt/openDCIM/.htpasswd dcim
firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --reload
systemctl reload httpd
https://<server ip goes here>