====== Inštalácia a nastavenie databázy ====== Nainštalujeme a nastavíme databázu MariaDB. apt install --no-install-recommends mariadb-server mariadb-client libmariadb-java Vygenerujeme heslo pre používateľa root: openssl rand -hex 20 Pokračujeme základnými nastaveniami: mysql_secure_installation Proces inštalácie prebieha nasledovne, môžeme použiť nastavenia v príklade: NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] Y New password: zadáme vygenerované heslo Re-enter new password: zopakujeme vygenerované heslo Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] Y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! Prihlásime sa do databázy: mysql Vytvoríme databázu "shibboleth" a v nej tabuľku "shibpid". SET NAMES 'utf8'; SET CHARACTER SET utf8; CHARSET utf8; CREATE DATABASE IF NOT EXISTS shibboleth CHARACTER SET=utf8; USE shibboleth; CREATE TABLE IF NOT EXISTS `shibpid` ( `localEntity` VARCHAR(255) NOT NULL, `peerEntity` VARCHAR(255) NOT NULL, `principalName` VARCHAR(255) NOT NULL DEFAULT '', `localId` VARCHAR(255) NOT NULL, `persistentId` VARCHAR(50) NOT NULL, `peerProvidedId` VARCHAR(255) DEFAULT NULL, `creationDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `deactivationDate` TIMESTAMP NULL DEFAULT NULL, PRIMARY KEY (`localEntity`, `peerEntity`, `persistentId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Môžeme skontrolovať pomocou: MariaDB [shibboleth]> DESCRIBE shibpid; Výstup by mal zodpovedať: +------------------+--------------+------+-----+---------------------+-------------------------------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------------------+-------------------------------+ | localEntity | varchar(255) | NO | PRI | NULL | | | peerEntity | varchar(255) | NO | PRI | NULL | | | principalName | varchar(255) | NO | | | | | localId | varchar(255) | NO | | NULL | | | persistentId | varchar(50) | NO | PRI | NULL | | | peerProvidedId | varchar(255) | YES | | NULL | | | creationDate | timestamp | NO | | current_timestamp() | on update current_timestamp() | | deactivationDate | timestamp | YES | | NULL | | +------------------+--------------+------+-----+---------------------+-------------------------------+ 8 rows Vytvoríme používateľa shibboleth a vygenerujeme pre neho silné heslo: openssl rand -hex 20 Prihlásime sa do databázy a vytvoríme používateľa: GRANT ALL PRIVILEGES ON shibboleth.* TO 'shibboleth'@'localhost' IDENTIFIED BY 'vygenerovane silné heslo'; FLUSH PRIVILEGES; Pre overenie vytvoreného používateľského účtu použijeme príkaz: mysql -u shibboleth -p shibboleth Po zadaní vygenerovaného hesla, ktoré sme si pre účel vytvorenia používateľa shibboleth nastavili, by sme sa mali úspešne prihlásiť do databázy. Pre odhlásenie použijeme "exit". V databáze shibboleth ďalej vytvoríme tabuľku "StorageRecords": > StorageConfiguration - ClientStorageService >> https://wiki.shibboleth.net/confluence/display/IDP4/StorageConfiguration#StorageConfiguration-ClientStorageService USE shibboleth; CREATE TABLE IF NOT EXISTS `StorageRecords` ( `context` varchar(255) NOT NULL, `id` varchar(255) NOT NULL, `expires` bigint(20) DEFAULT NULL, `value` longtext NOT NULL, `version` bigint(20) NOT NULL, PRIMARY KEY (`context`,`id`) )ENGINE=InnoDB DEFAULT CHARSET=utf8; Výstup by mal zodpovedať: MariaDB [shibboleth]> DESCRIBE StorageRecords; +---------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------+--------------+------+-----+---------+-------+ | context | varchar(255) | NO | PRI | NULL | | | id | varchar(255) | NO | PRI | NULL | | | expires | bigint(20) | YES | | NULL | | | value | longtext | NO | | NULL | | | version | bigint(20) | NO | | NULL | | +---------+--------------+------+-----+---------+-------+ 5 rows Môžete pokračovať [[install:idp:instalacia_a_nastavenie_jetty|Inštalácia a nastavenie Jetty]].