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 (
MůžePluginbýtvyžadujepoužitoiUser.Read) - openid (
MůžePluginbýtvyžadujepoužitoiUser.Read) - profile (
MůžePluginbýtvyžadujepoužitoiUser.Read) - GroupMember.Read.All
- email (
- =>
[ 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
-
BookStackDokuWiki - Přejít na
Admin>Extension manager>Search & Install(https://$FQDN/doku.php?id=wiki:welcome&do=admin&page=extension&tab=search&q=)
oauth
Nainstalovat oauth plugin a oAuth Azure Service
Přejít na Admin > Configuration settings (https://$FQDN/doku.php?id=wiki:welcome&do=admin&page=config)
Authentication nastavit authtype na oauth
V sekci Oauth:
plugin»oauth»custom-redirectURI na veřejnou URI wikiny následované suffixem doku.php (https://$FQDN/doku.php)
Oauthazure:
=>AUTH_METHODplugin»oauthazure»keyoidc
AUTH_AUTO_INITIATEfalsetrueOIDC_NAMEBalonKluk MSOIDC_DISPLAY_NAME_CLAIMSnameOIDC_CLIENT_ID<Application (client) ID>
OIDC_CLIENT_SECRETplugin»oauthazure»secret => Certificates & secrets💡 Po uložení políčko
Client Secretneobsahuje nic, ale to je v pořádku 😄
OIDC_ISSUERplugin»oauthazure»tenant => plugin oauthazure tenant: https://login.microsoftonline.com/< Directory (tenant) ID >/v2.0
OIDC_ISSUER_DISCOVERplugin»oauthazure»fetchgroups => trueBy user groups. Enabling this option fetches group data.: <issuer>/.well-known/openid-configurationOIDC_USER_TO_GROUPSpokud truesynchronizovat GroupMember.Read.All.
Admin⚠️
Pokudconsent!)bychom toto nepotřebovali, odebrat scope z EntraID aplikace!
OIDC_GROUPS_CLAIMplugin»oauthazure»stripdomain => groupsStrip užiatelskéjsou📋
skupinyAbyzískárny.)
OIDC_ADDITIONAL_SCOPESUPN.
OIDC_REMOVE_FROM_GROUPSfalse