DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

install:apache

Apache

  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

/etc/dokuwiki/apache.conf

  • change Alias and Allow from localhost 127.0.0.1 ::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
AllowOverride All
order allow,deny
	Allow from localhost 127.0.0.1 ::1

        <IfModule mod_rewrite.c>

                # Uncomment to implement server-side URL rewriting
                # (cf. <http://www.dokuwiki.org/config:userewrite>).
                        # 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]
        </IfModule>
</Directory>

<Directory /usr/share/dokuwiki/bin>
        Require all denied
</Directory>

<Directory /var/lib/dokuwiki/data>
        Require all denied
</Directory>

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: 2017-10-11 21:00 by 207.66.202.130