install_dokuwiki
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| install_dokuwiki [2019/01/30 10:09] – created msvoelker | install_dokuwiki [2024/04/24 12:27] (current) – msvoelker | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Install DokuWiki ====== | ====== Install DokuWiki ====== | ||
| - | A FreeBSD | + | A FreeBSD |
| + | |||
| + | ===== Install | ||
| Install DokuWiki and Apache. | Install DokuWiki and Apache. | ||
| - | sudo pkg install dokuwiki | + | sudo pkg install dokuwiki-php82 |
| sudo pkg install apache24 | sudo pkg install apache24 | ||
| Line 13: | Line 15: | ||
| # | # | ||
| DocumentRoot "/ | DocumentRoot "/ | ||
| - | | + | |
| < | < | ||
| - | Options Indexes FollowSymLinks | + | |
| - | DirectoryIndex index.php | + | DirectoryIndex index.php |
| - | AllowOverride None | + | AllowOverride None |
| - | Require all granted | + | Require all granted |
| </ | </ | ||
| Install PHP module | Install PHP module | ||
| - | sudo pkg install | + | sudo pkg install |
| check if the LoadModule line was added | check if the LoadModule line was added | ||
| Line 28: | Line 30: | ||
| should output | should output | ||
| - | LoadModule | + | LoadModule |
| add in / | add in / | ||
| - | < | + | < |
| DirectoryIndex index.php index.html | DirectoryIndex index.php index.html | ||
| AddType application/ | AddType application/ | ||
| Line 43: | Line 45: | ||
| restart FreeBSD | restart FreeBSD | ||
| - | open wiki install.php in browser | + | For a initial config, |
| http:// | http:// | ||
| Line 55: | Line 57: | ||
| after that / | after that / | ||
| - | create | + | It is recommended to separate config and binaries from DokuWiki website files. Create a directory outside of the installation path |
| sudo mkdir -p / | sudo mkdir -p / | ||
| Line 63: | Line 65: | ||
| sudo mv / | sudo mv / | ||
| - | set owner of / | + | It is important that the www user (the user that runs apache) has access to these files --> |
| sudo chown -R www:www / | sudo chown -R www:www / | ||
| - | create | + | DokuWiki needs to know where to find these files. Create |
| sudo vi / | sudo vi / | ||
| - | and add | + | and add |
| <?php | <?php | ||
| // DO NOT use a closing php tag. This causes a problem with the feeds, | // DO NOT use a closing php tag. This causes a problem with the feeds, | ||
| // among other things. For more information on this issue, please see:w | // among other things. For more information on this issue, please see:w | ||
| - | // http:// | + | // http:// |
| define(' | define(' | ||
| Line 79: | Line 81: | ||
| $conf[' | $conf[' | ||
| - | Backup | + | ===== Use https ===== |
| - | tar czf dokuwiki_`date +"%Y%m%d" | + | |
| - | save on Apple Time Capsule? | + | The server needs a certificate to provide https access. If a certificate in a .p12 file format exist, convert it into a .pem file. |
| - | Notification on error? | + | |
| + | openssl pkcs12 -in certificate.p12 -out certificate.pem -nodes | ||
| + | |||
| + | Copy the .pem file in a .crt and .key file | ||
| + | |||
| + | cp certificate.pem certificate.crt | ||
| + | cp certificate.pem certificate.key | ||
| + | |||
| + | The .crt file should contain the public certificate only. Edit the file and remove everything except the following Block. | ||
| + | |||
| + | < | ||
| + | -----BEGIN CERTIFICATE----- | ||
| + | ... | ||
| + | -----END CERTIFICATE----- | ||
| + | </ | ||
| + | |||
| + | The .key file should contain the private key only. Edit the file and remove everything except the following Block. | ||
| + | |||
| + | < | ||
| + | -----BEGIN PRIVATE KEY----- | ||
| + | ... | ||
| + | -----END PRIVATE KEY----- | ||
| + | </ | ||
| + | |||
| + | Copy both files to / | ||
| + | |||
| + | mkdir / | ||
| + | cp certificate.crt / | ||
| + | cp certificate.key / | ||
| + | |||
| + | Configure apache for SSL access. In / | ||
| + | |||
| + | Uncomment the line | ||
| + | |||
| + | LoadModule ssl_module libexec/ | ||
| + | |||
| + | Add | ||
| + | |||
| + | < | ||
| + | SSLRandomSeed startup builtin | ||
| + | SSLRandomSeed connect builtin | ||
| + | </ | ||
| + | |||
| + | and add | ||
| + | |||
| + | ServerName nplab.fh-muenster.de: | ||
| + | SSLEngine on | ||
| + | SSLCertificateFile "/ | ||
| + | SSLCertificateKeyFile "/ | ||
| + | |||
| + | To apply these changes, restart Apache serivce | ||
| + | |||
| + | sudo service apache24 restart | ||
| + | |||
| + | On error, check / | ||
| + | |||
| + | ===== Impressum im Footer ===== | ||
| + | |||
| + | In / | ||
| + | |||
| + | <a href="/ | ||
| + | |||
| + | Der Link verweist auf eine normale Wiki-Seite, die ggf. mit beliebigen Text gefüllt werden kann. | ||
| + | |||
| + | ===== Backup | ||
| + | |||
| + | For a automatic backup, the DokuWiki files are compressed in a tar.gz archive and copied to another server (bsd19.fh-muenster.de (console)). This is done by | ||
| + | a separate user named wikibackup. | ||
| + | |||
| + | Create user wikibackup on source and destination system (nplab.fh-muenster.de and bsd19.fh-muenster.de). | ||
| + | |||
| + | adduser | ||
| + | |||
| + | * Username: wikibackup | ||
| + | * Do not add the user in any group | ||
| + | * Shell: nologin | ||
| + | * Use password-based authentication?: | ||
| + | |||
| + | wikibackup@nplab.fh-muenster.de needs to ssh to bsd19.fh-muenster.de without entering a password. On nplab.fh-muenster.de, | ||
| + | te SSH keys. | ||
| + | |||
| + | sudo su - wikibackup | ||
| + | ssh-keygen | ||
| + | |||
| + | Copy the content of ~/ | ||
| + | |||
| + | ssh bsd19.fh-muenster.de | ||
| + | |||
| + | should work without entering a password. | ||
| + | |||
| + | Next step is to create the script that performs the backup and copies the backup file to bsd19.fh-muenster.de. | ||
| + | |||
| + | < | ||
| + | #!/bin/sh | ||
| + | |||
| + | echo $(date) | ||
| + | |||
| + | dayOfYear=$(date +%j) | ||
| + | file=~/ | ||
| + | |||
| + | echo backup wiki to $file | ||
| + | tar -czf $file -C / | ||
| + | nic-if\* | ||
| + | |||
| + | echo copy to bsd19 and delete local file | ||
| + | scp $file bsd19.fh-muenster.de: | ||
| + | rm $file | ||
| + | |||
| + | echo done | ||
| + | </ | ||
| + | |||
| + | To start the script daily, create a cron job. On nplab.fh-muenster.de as wikibackup, run | ||
| + | |||
| + | crontab -e | ||
| + | |||
| + | and add | ||
| + | |||
| + | < | ||
| + | SHELL=/ | ||
| + | PATH=/ | ||
| + | # Order of crontab fields | ||
| + | # minute | ||
| + | 0 | ||
| + | </ | ||
| + | |||
| + | |||
install_dokuwiki.1548842967.txt.gz · Last modified: by msvoelker
