DokuWiki - Instalace, Konfigurace
Návod pro instalaci a konfiguraci DokuWiki pro Debian GNU/Linux s využitím Apache web serveru. Návod čerpá z oficiálního návodu.
Systém
- Nainstalovat závislosti:
apt update apt install php libapache2-mod-php php-xml php-json php-mbstring php-zip php-intl php-gd php-sqlite3
Apache
- Aktivovat
Apachemoduly:a2enmod rewrite a2enmod headers
Instalace
Jelikož je DokuWiki úplně statická, řešíme jen jak dostat software na server a vystavit jej do sítě.
Apache
-
Přepsat výchozí konfigurační soubor Apache. Používám
letsencrypt, pokud by to mělo být jinde, je potřeba upravit.FQDN_SERVERU=dokuwiki.cvut.it ADMIN_MAIL=lmaoman@cvut.it cat > /etc/apache2/sites-available/000-default.conf << EOL <VirtualHost *:443> ### Base settings ServerAdmin $ADMIN_MAIL DocumentRoot /srv/http/dokuwiki # Prevent access to data directories <Directory /srv/http/dokuwiki/data> Require all denied </Directory> <Directory /srv/http/dokuwiki/conf> Require all denied </Directory> <Directory /srv/http/dokuwiki/bin> Require all denied </Directory> # Allow access to the main directory <Directory /srv/http/dokuwiki> Options -Indexes +FollowSymLinks AllowOverride All Require all granted </Directory> ## SSL ServerName balonluk.fit.cvut.cz Include /etc/letsencrypt/options-ssl-apache.conf ## Log # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # allow .htaccess <Directory /srv/http/dokuwiki> AllowOverride All </Directory> ### Location settings <Location /> SSLRequireSSL SSLOptions +StdEnvVars Options Indexes Includes FollowSymLinks AllowOverride AuthConfig Limit Order allow,deny Allow from all </Location> SSLCertificateFile /etc/letsencrypt/live/$FQDN_SERVERU/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/$FQDN_SERVERU/privkey.pem </VirtualHost> EOL -
Otestovat, že je konfigurace v pořádku:
apachectl configtest -
Restartovat webserver:
systemctl restart apache2
DokuWiki
- Vytvořit si složky pro hosting, třeba
/srv/http/dokuwikimkdir -p /srv/http/dokuwiki - Stáhnout zdroj a rozbalit:
cd /srv/http/dokuwiki wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz tar xzvf dokuwiki-stable.tgz --strip-components=1 && \ rm -fv dokuwiki-stable.tgz - Otevřít adresu webserveru s postfixem
install.php, takže např:https://dokuwiki.cvut.it/install.phpa dokončit instalaci DokuWiki.
Hotovo 🙂↔️
Konfigurace
Poskytovatel identit
OpenID Connect
Entra ID
🗒️ V tomto návodu používáme plugin oauthazure který pro svou funkčnost vyžaduje plugin:oauth.
Jak nastavíme OIDC pomocí vlastní Entra ID ?
-
EntraID
- Vytvořit App registration.
Authentication=>[ + Add a platform ]=>Web=> NastavitRedirect URInahttps://$FQDN/doku.php. Například:https://dokuwiki.cvut.it/doku.phpCertificates & secrets=>[ + New client secret ]=> < Pojmenovat si klíč a nastavit platnost (volil bych nejdelší - 24 měsíců) > =>[Add]. Zkopírovat HODNOTU (Value), nikoliv Secret ID a uložit si jej někam (později jej budeme potřebovat).Token configuration=>[ + Add groups claim ]=>Customize token properties by type=>- [X] Security groups
- [ ] Directory roles
- [ ] All groups (includes 3 group types: security groups, directory roles, and distribution lists)
- [ ] Groups assigned to the application (recommended for large enterprise companies to avoid exceeding the limit on the number of groups a token can emit)
- Customize token properties by type:
- ID:
- sAMAccountName
- ID:
API permissions[ + Add a permission ]=>Microsoft Graph=>Delegated permissions=>- OpenId permissions
🗒️
User.Read=> Allows users to sign-in to the app, and allows the app to read the profile of signed-in users. It also allows the app to read basic company information of signed-in users.
GroupMember.Read.All=> Allows the app to list groups, read basic group properties and read membership of all groups the signed-in user has access to.- email (Plugin vyžaduje i
User.Read) - openid (Plugin vyžaduje i
User.Read) - profile (Plugin vyžaduje i
User.Read) - GroupMember.Read.All
- email (Plugin vyžaduje i
- =>
[ Add permissions ] - Kliknout na
[ Grand admin consent for <jméno tvého tenantu> ]. Toto je nutné pro scopeGroupMember.Read.All, u ostatních jde vybratRevoke admin consent.🗒️ Tato akce udělí všem uživatelům oprávnění používat tento scope v této aplikaci.
- OpenId permissions
-
DokuWiki
- Přejít na
Admin>Extension manager>Search & Install(https://$FQDN/doku.php?id=wiki:welcome&do=admin&page=extension&tab=search&q=) - Vyhledat
oauth - Nainstalovat
oauth pluginaoAuth Azure Service - Přejít na
Admin>Configuration settings(https://$FQDN/doku.php?id=wiki:welcome&do=admin&page=config)- V sekci
Authenticationnastavit authtype naoauth - V sekci
Oauth:- Pokud používáme reverzní proxy nastavit
plugin»oauth»custom-redirectURIna veřejnou URI wikiny následované suffixemdoku.php(https://$FQDN/doku.php)
- Pokud používáme reverzní proxy nastavit
- V sekci
- V sekci
Oauthazure:plugin»oauthazure»key=> Client ID:Application (client) IDplugin»oauthazure»secret=> Client Secret: <Ve třetím bodu EntraID uCertificates & secretsjsme si vytvořili secret, vložit sem>💡 Po uložení políčko
Client Secretneobsahuje nic, ale to je v pořádku 😄plugin»oauthazure»tenant=> plugin oauthazure tenant:Directory (tenant) IDplugin»oauthazure»fetchgroups=> By default only roles from the JWT are used as user groups. Enabling this option fetches group data.: <Zaškrtnout pokud chceme synchronizovat skupiny což nám zajistil scopeGroupMember.Read.All.⚠️ Pokud bychom toto nepotřebovali, odebrat scope z EntraID aplikace!
- plugin»oauthazure»stripdomain => Strip @domain from preferred_username: [X]
📋 Aby užiatelské jméno byl pouze username a ne
UPN.
- Přejít na
No comments to display
No comments to display