Gebruikershulpmiddelen

Site-hulpmiddelen


installatie_handleidingen:dokuwiki

Dit is een oude revisie van het document!


DokuWiki op CentOS7

Tools

Installeer de tools die tijdens de install nodig hebt. Na de install is het zinnig om ze weer te verwijderen.

yum install wget

Pre-requisites

Apache webserver

In het geval je deze nog niet hebt, installeer een Apache server met virtual hosts

SSL Certificaten

ga naar de directory waar je de certificaten wilt opslaan
cd /etc/ssl/certs

maak de server key:
openssl genrsa -des3 -out wiki.auriel.nl.key 2048

Er zit verplicht een passphrase op de key. Die moet er af anders moet je die elke keer opgeven als apache start, dit betekent dat de server niet autonoom kan opstarten. haal je hem er als volgt af:
openssl rsa -in wiki.auriel.nl.key -out wiki.auriel.nl.key
chmod 600 wiki.auriel.nl.key

maak een certificate signing request:
openssl req -new -key wiki.auriel.nl.key-out wiki.auriel.nl.csr

en vul alles in

You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:NL
State or Province Name (full name) []:Zuid Holland
Locality Name (eg, city) [Default City]:Den Haag
Organization Name (eg, company) [Default Company Ltd]:Boerema CI&ND
Organizational Unit Name (eg, section) []:IT Dept.
Common Name (eg, your name or your server's hostname) []:wiki.auriel.nl
Email Address []:webmaster@auriel.nl

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

maak het self-signed certificaat aan:
openssl x509 -req -days 3650 -in wiki.auriel.nl.csr -signkey wiki.auriel.nl.key -out wiki.auriel.nl.crt

PHP

installeer php en de nodige module:

yum install php php-gd

vi /etc/php.ini

en voeg toe:

date.timezone = Europe/Amsterdam

;Harden de PHP install
expose_php = Off
cgi.fix_pathinfo = 0
max_input_vars = 10000 

docuwiki installatie

Apache Vhost

Maak een vhost configuratie file aan: vi /etc/httpd/sites-available/wiki.auriel.nl-ssl.conf

en zet hierin:

<VirtualHost 192.168.1.202:80>
    ServerAdmin webmaster@auriel.nl
    ServerName wiki.auriel.nl
    Redirect / https://wiki.auriel.nl
</VirtualHost>

<VirtualHost 192.168.1.202:443>
    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/wiki.auriel.nl.crt
    SSLCertificateKeyFile /etc/ssl/certs/wiki.auriel.nl.key
    SSLProtocol All -SSLv2 -SSLv3
    BrowserMatch "MSIE [2-5]" \
             nokeepalive ssl-unclean-shutdown \
             downgrade-1.0 force-response-1.0
             
    ServerName wiki.auriel.nl
    ServerAlias www.wiki.auriel.nl
    ServerAdmin webmaster@auriel.nl
    DocumentRoot "/var/www/html/dokuwiki"
    ErrorLog "/var/log/httpd/wiki.auriel.nl-error_log"
    CustomLog "/var/log/httpd/wiki.auriel.nl-access_log" combined

    <Directory "/var/www/html/dokuwiki/">
        DirectoryIndex index.php
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Zet vervolgens een link in de sites-enabled:

ln -s /etc/httpd/sites-available/wiki.auriel.nl-ssl.conf /etc/httpd/sites-enabled/wiki.auriel.nl-ssl.conf

zorg dat de DNS (router) de hostname kent, door in de hosts op te nemen:

192.168.1.202 wiki.auriel.nl

en herstart apache: systemctl restart httpd.service

installeren

Ga naar de documet root: cd /var/www/html/

haal de laatste versie van docuwiki op en pak daar uit:

wget http://download.dokuwiki.org/out/dokuwiki-stable.tgz
tar -xvzf dokuwiki-stable.tgz

zet vervolgens de permissies goed: chown apache: -R /var/www/html/dokuwiki

De SeLinux settings staan default op read, maar sommige directories moeten read/write zijn. Fix dit door:

semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/dokuwiki/conf(/.*)?"
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/dokuwiki/data(/.*)?"
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/dokuwiki/lib/plugins(/.*)?"
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/dokuwiki/lib/tpl(/.*)?"
restorecon -R -v /var/www/html/dokuwiki

Dokuwiki configuratie

Start de webinstaller door met de browser de volgende link te openen: http:/wiki.auriel.nl/install.php . Vul als volgt in:

ga vervolgens naar de wiki:

Verwijder de playground namespace door in de webinterface de playground pagina te bewerken, leeg te maken, en op te slaan. Log uit en in, en de playground is verdwenen.

Cleanup

Nog even opruimen door:

rm /var/www/html/dokuwiki-stable.tgz

rm -f /var/www/html/dokuwiki/install.php

yum remove wget

installatie_handleidingen/dokuwiki.1449239349.txt.gz · Laatst gewijzigd: 2015/12/04 15:29 door abel