Inhaltsverzeichnis
Erzeugung eines DokuWiki USB Sticks zur Ausführung unter Ubuntu und Windows
Wenn Sie einen USB-Stick auch unter 64bit Ubuntu laufen lassen wollen, müssen Sie eine zusätzliche Partition auf Ihrem USB-Stick erstellen. Es ist wahrscheinlich am besten, dies vor der Installation der Windows Lösung zu tun, aber wenn Sie dies bereits getan haben, dann können Sie die Dateien an einen temporären Speicherort kopieren, Ihren USB-Stick neu formatieren und dann zurückkopieren. Sie können mit Hilfe von z.B. GParted, die Größe der bestehenden Partition anpassen.
These are the partitions
- A FAT32 partition to hold the wiki. Name this „WIKI“. Keep it uppercase for Windows to work,
- An ext3 partition of around 240mb. Name this „linuxWiki“. The files consume around 65Mb and so 240Mb gives plenty of spare
- Install the windows Dokuwiki on the fat32 partition named WIKI. Follow the instructions above to achieve this.
Linux-Ausführung. Wird auf der Linux-Wiki-Partition installiert
HTTP Interpreter
To execute the wiki you need a small server that can interpret http format. The chosen server needs to execute from the stick. One that works out of the box is Mongoose https://code.google.com/archive/p/mongoose/ The download page is https://code.google.com/archive/p/mongoose/downloads The binary file mongoose-lua-sqlite-ssl-static-x86_64-5.1 is required. It will process the http requests on localhost:8080 which will default to file doku.php The suffix php will then require a PHP interpretor.
PHP Interpreter
The version I downloaded was 5.5.38. http://php.net/downloads.php The newer version (7.1.3) also works fine but seemed slower.
unzip the download to obtain dir php-5.5.38
To build into a directory php
cd php-5.5.38/ ./configure --prefix=$HOME/php make make install
Once built we only need the one executable file located at $HOME/php/bin/php-cgi
Layout of files in partition linuxWiki
/media/mike/linuxWiki$ tree . ├── linuxStart.sh ├── server │ ├── dokuwiki -> ../../WIKI/dokuwiki │ ├── mongoose.conf │ ├── mongoose-lua-sqlite-ssl-static-x86_64-5.1 │ └── php-cgi └── startWiki.desktop
Die Datei startWiki.desktop
This is a .desktop file that allows execution of the shell script file linuxStart.sh from the Nautilus file browser.
Der Inhalt der Datei ist folgender:
[Desktop Entry] Type=Application Terminal=true Name=Start Dokuwiki Icon=utilities-terminal Exec=bash -c 'cd "$(dirname %k)";./linuxStart.sh;$SHELL' Categories=Application;
Once created set its permissions to allow execute
chmod +x startWiki.desktop
Die Datei linuxStart.sh
This also needs its execution bit set and can be started from command line of a terminal if you prefer not to use Nautilus. Its content is
#!/bin/bash cd server echo "Open a browser to address 127.0.0.1:8080" echo "Leave this terminal window running until you no longer need the http server to access the wiki" echo "close the terminal when finished so that you can unmount the usb stick" ./mongoose-lua-sqlite-ssl-static-x86_64-5.1
This will start the mongoose http server. This server needs a configuration file.
Die Datei server/mongoose.conf
This configuration file directs mongoose to use the php-cgi program to interpret http links to files of type *.php. It also sets the document_root to directory dokuWiki which we see in the moment is a symbolic link to the dokuWiki directory on the fat32 partition and the defult run file becomes index.php which calls doku.php to start the wiki engine.
cgi_interpreter ./php-cgi enable_directory_listing no document_root dokuwiki
The other command setting directory listings off is a security measure to stop the display of a directory list for any paths which don't contain an index.php or index.html file. See mongoose.
Dir server/dokuWiki
This links back to the fat32 partition where the dokuwiki installation resides. Create it via command
ln -s ../../WIKI/dokuwiki dokuwiki
Die http und php Server Dateien
Diese wurden in den ersten beiden Schritten erstellt. Kopieren Sie die beiden genannten Dateien in das Serververzeichnis und setzen Sie das Ausführungsbit (execution bit) bei beiden Dateien.
Bestehende Besonderheiten
Wenn Sie 'localhost:8080' als Speicherort Ihres Wikis verwenden, werden Sie feststellen, dass die Dokuwiki-Medienmanager-Seite Probleme hat, die es verhindern, Mediendateien zu laden. Wenn Sie stattdessen Ihren Browser mit '127.0.0.1:8080' oder 'yourMachinesHostName:8080' aufrufen, wird dieses Problem vermieden.