It's better when it's simple

User Tools

Site Tools



  1. Create /etc/dokuwiki/apache.conf
  2. Link
    ls -l /etc/apache2/sites-available/
    lrwxrwxrwx 1 root root   25 Apr  5  2014 dokuwiki.conf -> /etc/dokuwiki/apache.conf 

    according to apache

  3. Enable the site with a2ensite dokuwiki
  4. Restart / Reload apache
  5. Setup Security


(APACHE2.4 you can new file in Includes e.g. wiki.conf)

  • change Alias and Allow from localhost ::1 to your needs
AliasMatch ^/dokuwiki/sites/[^/]+$      /usr/share/dokuwiki/
AliasMatch ^/dokuwiki/sites/[^/]+/(.*)$ /usr/share/dokuwiki/$1
Alias      /dokuwiki                    /usr/share/dokuwiki/

<Directory /usr/share/dokuwiki/>
Options +FollowSymLinks
require all granted
	#Allow from localhost ::1

        <IfModule mod_rewrite.c>

                # Uncomment to implement server-side URL rewriting
                # (cf. <>).
                        # Do *not* mix that with multisite!
                #RewriteEngine on
                #RewriteBase /dokuwiki
                #RewriteRule ^lib                      - [L]
                #RewriteRule ^doku.php                 - [L]
                #RewriteRule ^feed.php                 - [L]
                #RewriteRule ^install.php              - [L]                
                #RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
                #RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1 [QSA,L]
                #RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_$1&id=$2 [QSA,L]
                #RewriteRule ^$                        doku.php  [L]
                #RewriteRule (.*)                      doku.php?id=$1  [QSA,L]

<Directory /usr/share/dokuwiki/bin>
        Require all denied
        ##FOR VER APACHE2.4

<Directory /var/lib/dokuwiki/data>
        Require all denied
        ##FOR VER APACHE2.4

Nice URLs using the .htaccess setting

Dokuwiki comes with a distribution copy of the .htaccess-file called .htaccess.dist. In the package manager installation, this file will be found in /etc/dokuwiki; in the standard Dokuwiki installation it will be found in your top-level dokuwiki directory. Copy this file to .htaccess. Then uncomment all of the commented-out lines except for the https and and xmlrpc entries; you may want to enable these features at a later time but leave them alone initially. Commented lines begin with a hash (number sign), as in:

   #RewriteEngine on

Remove the hash to uncomment the line:

    RewriteEngine on

Uncommenting the lines will create a set of substitutions which the web server will make in order to format nice urls.

The next thing you need to do is to enable apache's rewrite module. Again from the command line:

    sudo a2enmod rewrite

This will update the configuration files; then you must restart the server:

     sudo service apache2 restart

It should be noted that if ever the service command does not work, you can do the same with this command:

   sudo /etc/init.d/apache2 restart

You must always use sudo with these commands because they require root user access.

install/apache.txt · Last modified: 2018-03-22 09:58 by beimak

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki