====== Wiki-Syntax ======
* [[wiki:syntax]]
**Fetter Text**
//Kursiver Text//
tiefgestellt und hochgestellt
__Unterstrichener Text__
''Code Text''
Durchgestrichener Text
====== Level 1 Überschrift ======
===== Level 2 Überschrift =====
==== Level 3 Überschrift ====
=== Level 4 Überschrift ===
== Level 5 Überschrift ==
[[Interner Link]]
[[http://example.com|Externer Link]]
- Nummerierter Listenpunkt
* Listenpunkt
---- - waagerechter Strich
{{bild.png|}} - Bild (nur Kleinschreibung erlaubt!)
{{bild.png?768x600}} - Bild skaliert zu fester Aufl. (nur Kleinschreibung erlaubt!)
{{dokument.pdf|}} - PDF-Datei (nur Kleinschreibung erlaubt!)
{{testprogramm.exe|}} - Demo-Programm für den Download (nur Kleinschreibung erlaubt!)
Bild- und PDF-Dateien müssen direkt in das Verzeichnis ///var/lib/dokuwiki/data/media/// bzw. ///usr/local/www/dokuwiki/data/media/// mit den Rechten //www-data:www-data// bzw. //www:www// abgelegt werden.
Dabei ist unbedingt auf den Dateinamen zu achten!
Der Dateiname darf nur aus kleinen Buchstaben, Zahlen und dem Unterstrich in einfacher Form bestehen. Zwei Unterstriche hintereinander stellen auch einen Ungültigen Dateinamensbestandteil dar!
===== DokuWiki konfigurieren =====
* [[http://www.dokuwiki.org/config|Configuring DokuWiki]]
* **[[https://www.dokuwiki.org/security|Security]]**
Wenn man das [[http://download.dokuwiki.org|TGZ]] von der Web-Seite installiert, dann muss man die Verzeichnisrechte anpassen:
> wget http://download.dokuwiki.org/out/dokuwiki-d9556fbc2c1c07a0baaf81c07d4165f6.tgz
> tar xzf dokuwiki-d9556fbc2c1c07a0baaf81c07d4165f6.tgz
> mv dokuwiki/* /var/www/html/
> cd /var/www/html/
> for A in bin conf data inc lib vendor ; do chmod 0750 ${A} ; done
> for A in conf data inc lib vendor ; do chown www:0 ${A} ; done
> ls -lha
drwxr-xr-x 8 root wheel 16B Oct 14 2018 .
drwxr-xr-x 20 root www 37B Dec 8 09:48 ..
-rw-r--r-- 1 root wheel 1.6K Oct 14 2018 .htaccess.dist
-rw-r--r-- 1 root wheel 18K Oct 14 2018 COPYING
-rw-r--r-- 1 root wheel 306B Oct 14 2018 README
-rw-r--r-- 1 root wheel 21B Oct 14 2018 VERSION
drwxr-x--- 2 root wheel 512B Mar 7 02:19 bin
drwxr-x--- 2 www wheel 27B Oct 14 2018 conf
drwxr-x--- 12 www wheel 17B Apr 13 2016 data
-rw-r--r-- 1 root wheel 3.5K Oct 14 2018 doku.php
-rw-r--r-- 1 root wheel 19K Oct 14 2018 feed.php
drwxr-x--- 20 www wheel 2.5K Mar 7 02:19 inc
-rw-r--r-- 1 root wheel 2.0K Oct 14 2018 index.php
-rw-r--r-- 1 root wheel 20K Apr 13 2016 install.php
drwxr-x--- 8 www wheel 512B Mar 7 02:19 lib
drwxr-x--- 11 www wheel 512B Mar 7 02:19 vendor
==== Den Index neu bauen ====
* [[https://www.dokuwiki.org/de:cli#indexerphp]]
* **[[http://wiki.stizi.de/web:dokuwiki:index]]**
FreeBSD:
> echo 'cd /usr/local/www/dokuwiki/data/ ; php ../bin/indexer.php -c' | su -l www
Debial / Ubuntu:
> su -c 'cd /var/www/dokuwiki/data ; php ../bin/indexer.php -c' www-data
==== Die Breite der Wiki-Seite ändern ====
* [[https://www.dokuwiki.org/template:dokuwiki#changing_the_width_and_other_styles]]
> vi lib/tpl/dokuwiki/style.ini
...
__site_width__ = "100%"
...
====== DokuWiki sichern ======
===== Ubuntu Linux =====
tar cf dokuwiki_sik.tar /var/lib/dokuwiki/ /etc/dokuwiki
===== FreeDSB =====
tar cf dokuwiki_sik.tar /usr/local/www/dokuwiki/ /usr/local/etc/apache22/Includes/dokuwiki.conf
====== DokuWiki installieren ======
===== Ubuntu =====
Installation und Konfiguration durch das Paketmanagement
aptitude install dokuwiki
/wiki
[*] apache2
[*] apache-ssl
lokale Konfigurationsdatei erstellen
cp /etc/dokuwiki/local.php.dist /etc/dokuwiki/local.php
auf deutsch einstellen
vi /etc/dokuwiki/local.php
$conf['lang'] = 'de';
damit es nicht nur lokal geht
vi /etc/dokuwiki/apache.conf
#allow from 127.0.0.1
allow from all
chown www-data:www-data /usr/share/dokuwiki/conf
Konfiguration im Browser
https://192.168.1.1/wiki/install.php
For security reasons this script will only work with a new and
unmodified Dokuwiki installation. You should either re-extract the files
from the downloaded package or consult the complete Dokuwiki
installation instructions
* unrecognised or modified dokuwiki.php
(hash=9100fa9a18424bd097b5ab972d66412d)
* /usr/share/dokuwiki/conf/local.php already exists
* /usr/share/dokuwiki/conf/users.auth.php already exists
* /usr/share/dokuwiki/conf/acl.auth.php already exists
----------------------------------------------------------
Aufruf im Browser
https://192.168.1.1/wiki/
===== FreeBSD 12.2 =====
Erstmal muss der Apache mit //mod_ssl// installiert werden:
portinstall -prO www/apache22
....
[X] SSL Enable mod_ssl
....
Dann das Wiki:
portinstall -prO www/dokuwiki
Jetzt machen wir dass wiki noch per //https// klar:
vi /usr/local/etc/apache22/Includes/dokuwiki.conf
Include etc/apache22/extra/httpd-ssl.conf
# http://freebsdrocks.net/index.php/guides-mainmenu-25/15-installing-apache-samba-etc/17-installing-apache-22
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
#
DirectoryIndex index.php index.html
#
# echo 'accf_http_load="YES"' >> /boot/loader.conf
# kldload accf_http
Alias /wiki "/usr/local/www/dokuwiki/"
#Options Indexes FollowSymLinks
#Options Indexes
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
Jetzt noch den apache neu starten:
# /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
Syntax OK
Stopping apache22.
Waiting for PIDS: 1117.
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.
So, und jetzt kann das Wiki eingerichtet werden:
https://192.168.1.1/wiki/install.php
Aufruf im Browser
https://192.168.1.1/wiki/
Ferti!
==== DokuWiki-Mehrfach-Installation - trotzdem einfaches Update ====
Ich lege meine Wiki's unter ''/home/http/'' an.
/home/http/wiki
/home/http/privat
/home/http/kinderwiki
Für das Update, die neueste Version von hier runter laden:
* [[http://download.dokuwiki.org/]]
Im Wiki-Verzeichnissen liegen praktisch nur die Wiki- und Zugangs-Daten.
Die Quell-Daten, in denen sich der Programm-Kode befindet, wird nur per symbolischer Links in das Wiki-Verzeichnis geholt.
> tar xzf dokuwiki-5422200921b877a379e34cc4e0fee22a.tgz -C /home/http/
Wir legen das Quell-Verzeichnis mit der Versionsnummer im Namen an, damit wir bei späteren Update-Vorgängen, mehrere Versionen nebeneinander liegen lassen können.
Das ist sinnvoll, um z.B. bei Problemen auf eine bestimmte oder wenigstens auf die letzte funktionierende Version zurück schalten zu können.
Das //zurück schalten// erfolgt durch den //symbolischen Link//, der ganz einfach nach belieben entsprechend den Erfordernissen gesetzt werden kann.
> cd /home/http/
> mv dokuwiki dokuwiki-5422200921b877a379e34cc4e0fee22a
> ln -s dokuwiki-5422200921b877a379e34cc4e0fee22a dokuwiki
> ls -lha /home/http/dokuwiki
lrwxr-xr-x 1 root www 41B 13 Apr 19:29 /home/http/dokuwiki -> dokuwiki-5422200921b877a379e34cc4e0fee22a
__Es ist auch möglich, dieses Referenz-Verzeichnis an einer anderen stelle im Dateisystem abzulegen.
Das hätte dann auch den Vorteil, dass man dieses reine Referenz-Wiki nicht gezielt im Browser aufrufen kann.__
=== DokuWiki-Mehrfach-Installation ===
> ls -lha /home/http/dokuwiki/
total 156
drwxr-xr-x 8 root wheel 16B 13 Apr 19:28 .
drwxr-xr-x 15 kontor www 28B 13 Apr 22:17 ..
-rw-rw-r-- 1 root wheel 1,5K 23 Aug 2015 .htaccess.dist
-rw-rw-r-- 1 root wheel 18K 23 Aug 2015 COPYING
-rw-rw-r-- 1 root wheel 306B 23 Aug 2015 README
-rw-rw-r-- 1 root wheel 23B 23 Aug 2015 VERSION
drwxr-xr-x 2 root www 9B 13 Apr 19:25 bin
drwxr-xr-x 2 www wheel 20B 14 Apr 22:30 conf
drwxr-xr-x 12 www wheel 17B 13 Apr 19:25 data
-rw-rw-r-- 1 root wheel 3,6K 23 Aug 2015 doku.php
-rw-rw-r-- 1 root wheel 19K 23 Aug 2015 feed.php
drwxr-xr-x 6 root www 62B 13 Apr 19:25 inc
-rw-rw-r-- 1 root wheel 182B 23 Aug 2015 index.php
-rw-rw-r-- 1 root wheel 20K 23 Aug 2015 install.php
drwxr-xr-x 8 root www 9B 13 Apr 19:25 lib
drwxr-xr-x 5 root www 7B 13 Apr 19:25 vendor
um die volle Breite im Wiki nutzen zu können, muss dieser Wert auf "100%" erhöht werden:
> vi /home/http/dokuwiki/lib/tpl/dokuwiki/style.ini
...
__site_width__ = "100%" ; @ini_site_width
...
die Basis für mein erstes Wiki initial anlegen:
> cp -a /home/http/dokuwiki-5422200921b877a379e34cc4e0fee22a /home/http/wiki
> cd /home/http/wiki/ || exit 1
> rm -fr bin inc lib vendor
> mkdir bin inc lib vendor
die Basis für mein zweites Wiki initial anlegen:
> cp -a /home/http/dokuwiki-5422200921b877a379e34cc4e0fee22a /home/http/privat
> cd /home/http/privat/ || exit 1
> rm -fr bin inc lib vendor
> mkdir bin inc lib vendor
die Basis für mein drittes Wiki initial anlegen:
> cp -a /home/http/dokuwiki-5422200921b877a379e34cc4e0fee22a /home/http/kinderwiki
> cd /home/http/kinderwiki/ || exit 1
> rm -fr bin inc lib vendor
> mkdir bin inc lib vendor
zum Schluß löschen wir noch die Installationsdatei aus dem Original-Verzeichnis, damit nur die drei verlinkten Wiki's konfiguriert werden können.
Sonst ist das ja keine Referenz mehr:
> rm -f /home/http/dokuwiki/install.php
Die meisten Verzeichnisse aus den Live-Wiki's sind Bind-Mount's, die in das Verzeichnis mit den originalen Quell-Daten zeigen, in denen sich der Programm-Kode befindet, damit nur das eine Verzeichniss aktualliesiert werden muss.
Mit Sym-Links funktioniert es nicht, dann werden die Media-Daten in das Originalverzeichnis geschrieben.
die Bind-Mount's müssen jetzt noch boot-fest gemacht werden:
...
#------------------------------------------------------------------------------#
### DokuWiki's
### Mit Sym-Links funktioniert es nicht,
### dann werden die Media-Daten in das Originalverzeichnis geschrieben.
/home/http/dokuwiki/bin /home/http/wiki/bin nullfs rw,late 0 0
/home/http/dokuwiki/inc /home/http/wiki/inc nullfs rw,late 0 0
/home/http/dokuwiki/lib /home/http/wiki/lib nullfs rw,late 0 0
/home/http/dokuwiki/vendor /home/http/wiki/vendor nullfs rw,late 0 0
/home/http/dokuwiki/bin /home/http/privat/bin nullfs rw,late 0 0
/home/http/dokuwiki/inc /home/http/privat/inc nullfs rw,late 0 0
/home/http/dokuwiki/lib /home/http/privat/lib nullfs rw,late 0 0
/home/http/dokuwiki/vendor /home/http/privat/vendor nullfs rw,late 0 0
/home/http/dokuwiki/bin /home/http/kinderwiki/bin nullfs rw,late 0 0
/home/http/dokuwiki/inc /home/http/kinderwiki/inc nullfs rw,late 0 0
/home/http/dokuwiki/lib /home/http/kinderwiki/lib nullfs rw,late 0 0
/home/http/dokuwiki/vendor /home/http/kinderwiki/vendor nullfs rw,late 0 0
#------------------------------------------------------------------------------#
...
jetzt die Bind-Mount-Verzeichnisse mounten:
> mount /home/http/wiki/bin
> mount /home/http/wiki/inc
> mount /home/http/wiki/lib
> mount /home/http/wiki/vendor
> mount /home/http/privat/bin
> mount /home/http/privat/inc
> mount /home/http/privat/lib
> mount /home/http/privat/vendor
> mount /home/http/kinderwiki/bin
> mount /home/http/kinderwiki/inc
> mount /home/http/kinderwiki/lib
> mount /home/http/kinderwiki/vendor
Das passiert ab jetzt bei jedem boot-Vorgang automatisch.
=== /usr/local/etc/apache24/httpd.conf ===
hier nur den wesentlichen Ausschnitt (weil hier Passwörter eingegeben werden, sollte man nur ''HTTPS'' einsetzen):
...
Listen *:443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLRandomSeed startup file:/dev/random 512
SSLRandomSeed connect file:/dev/random 512
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:/var/run/ssl_scache(512000)"
SSLSessionCacheTimeout 300
DocumentRoot "/home/http"
ServerName www.domain.de
ServerAdmin fritz@domain.de
ErrorLog "/var/log/httpd-error.log"
TransferLog "/var/log/httpd-access.log"
#
### ----------------
#
### Konfiguration fuer mod_ssl
SSLEngine on
SSLHonorCipherOrder On
SSLProtocol -ALL +TLSv1.2
SSLProxyProtocol -ALL +TLSv1.2
SSLCipherSuite TLSv1.2
SSLProxyCipherSuite TLSv1.2
SSLCertificateFile "/home/etc/ssl/dokuwiki.crt"
SSLCertificateKeyFile "/home/etc/ssl/dokuwiki.key"
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire +StdEnvVars
SSLVerifyClient optional
#SSLVerifyClient require
SSLVerifyDepth 10
SSLOptions +OptRenegotiate
#
TraceEnable Off
#
### ----------------
#
BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
CustomLog "/var/log/httpd-ssl_request.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
...
Jetzt kann man die drei Wiki's im Browser aufrufen:
https://www.domain.de/wiki
https://www.domain.de/privat
https://www.domain.de/kinderwiki
===== FreeBSD 13.1 =====
#!/bin/sh
################################################################
#
# Dieses Skript "repariert" das DokuWiki,
# indem es alle Rechte so setzt, wie sie sein müssen.
#
################################################################
VERSION="v2023040800"
################################################################
if [ x == "x${1}" ] || [ ! -d "${1}" ]
then
echo "USAGE: ${0} /path/to/dokuwiki"
exit 1
fi
DOKUWIKI_DIR="$(cd ${1}; pwd)"
################################################################
### Rechte vom neuen Verzeichnis setzen
chown 0:80 "${DOKUWIKI_DIR}"/
chown 0:0 "${DOKUWIKI_DIR}"/*
chown -R 0:80 "${DOKUWIKI_DIR}"/
#
for A in bin conf inc vendor
do
chmod 0750 "${DOKUWIKI_DIR}/${A}"
done
#
for B in bin conf inc
do
chown -R 80:0 "${DOKUWIKI_DIR}/${B}"
done
#
for C in Form lang parser
do
chown -R 0:0 "${DOKUWIKI_DIR}"/inc/"${C}"/
done
#
chown 0:0 "${DOKUWIKI_DIR}"/lib
chmod 0775 "${DOKUWIKI_DIR}"/lib
#
for D in plugins tpl
do
chown -R 80:80 "${DOKUWIKI_DIR}"/lib/"${D}"/
done
#
chmod 0770 "${DOKUWIKI_DIR}/data"
chown -R 80:80 "${DOKUWIKI_DIR}/data"
chown -R 80:80 "${DOKUWIKI_DIR}/data/tmp"
----
> /usr/local/sbin/dokuwiki-reparieren.sh /var/www/wiki
==== Dokuwiki Update ====
#!/bin/sh
VERSION="v2023040800" # initial erstellt
VERSION="v2023040900" # Fehĺerbehoben und übersichtlicher gestaltet
################################################################################
OLD_DIR="$(pwd)"
BACKUP_DIR="/home/Backup/dokuwiki"
HTTP_DIR="/var/www"
WIKI_INSTANCES="wiki privat kinderwiki"
if [ x == "x${1}" ] || [ ! -d "${1}" ]
then
echo "USAGE: ${0} /path/to/new/dokuwiki"
exit 1
fi
DOKUWIKI_DIR="$(cd ${1}; pwd)"
test -d "${BACKUP_DIR}" || (echo "Not found: ${BACKUP_DIR}"; exit 1)
for WIKI in ${WIKI_INSTANCES}
do
WIKI_DIR="${HTTP_DIR}/${WIKI}"
cd "${WIKI_DIR}" || (echo "Not found: ${WIKI_DIR}"; exit 1)
if [ -d "${BACKUP_DIR}/${WIKI}-data" ]
then
DATE="$(date +'%F_%H-%M-%S')"
ARCHIVE="${BACKUP_DIR}/${WIKI}-data.${DATE}"
mv "${BACKUP_DIR}/${WIKI}-data" "${ARCHIVE}"
echo "Found existing data backup, moved to ${ARCHIVE}"
fi
mv "${WIKI_DIR}/data" "${BACKUP_DIR}/${WIKI}-data"
tar -czf "${BACKUP_DIR}/${WIKI}-conf.tar.gz" \
$(ls \
conf/local.php \
conf/userstyle.css \
conf/userscript.js \
conf/*.auth.php \
conf/*.local.conf \
conf/*.local.json \
conf/*.local.php \
conf/*.protected.php \
2> /dev/null)
rm -fr "${WIKI_DIR}"
cp -a "${DOKUWIKI_DIR}" "${WIKI_DIR}"
rm -fr "${WIKI_DIR}/data"
mv "${BACKUP_DIR}/${WIKI}-data" "${WIKI_DIR}/data"
tar -xzf "${BACKUP_DIR}/${WIKI}-conf.tar.gz" -C "${WIKI_DIR}"/
########################################################
### Rechte vom neuen Verzeichnis setzen
/usr/local/sbin/dokuwiki-reparieren.sh "${WIKI_DIR}"/
########################################################
done
cd "${OLD_DIR}" || (echo "Not found: ${OLD_DIR}"; exit 1)
----
Den Wiki-Pfad (bzw. die Pfade) in dem Skript so setzen, wie er bei mir richtig ist:
> vi /usr/local/sbin/dokuwiki-update.sh dokuwiki
...
HTTP_DIR="/var/www"
WIKI_INSTANCES="wiki privat kinderwiki"
...
In diesem Beispiel wären es drei Wikis mit den folgenden Pfaden:
/var/www/wiki
/var/www/privat
/var/www/kinderwiki
Das neueste [[https://download.dokuwiki.org|DokuWiki]] runterladen.
...auspacken
> tar xzvf dokuwiki-a6b3119b5d16cfdee29a855275c5759f.tgz
> ls -lha
total 546
drwxr-xr-x 3 root wheel 3B Apr 9 03:31 .
drwxrwxrwt 483 root wheel 791B Apr 9 03:30 ..
drwxr-xr-x 8 root www 17B Apr 8 21:10 dokuwiki
Update durchführen:
> /usr/local/sbin/dokuwiki-update.sh dokuwiki